//--------------------------------------------------------------------
// Microsoft OLE DB Test
//
// Copyright 1995-2000 Microsoft Corporation.  
//
// @doc 
//
// @module OLE DB strings | Source file for OLE DB strings
//
// @comm
// Special Notes...:	(OPTIONAL NOTES FOR SPECIAL CIRCUMSTANCES)
//
// <nl><nl>
// Revision History:<nl>
//
// @head3 OLE DB Strings |
//
//---------------------------------------------------------------------------

#include "privstd.h"
#include "Strings.h"
#include "MiscFunc.h"


/////////////////////////////////////////////////////////////////////////////
// CString
//
/////////////////////////////////////////////////////////////////////////////
CString::CString()
{
	m_pszString = NULL;
}

/////////////////////////////////////////////////////////////////////////////
// CString
//
/////////////////////////////////////////////////////////////////////////////
CString::CString(LPCSTR pszString)
{
	//Delegate
	m_pszString = _strdup(pszString);
}

/////////////////////////////////////////////////////////////////////////////
// CString
//
/////////////////////////////////////////////////////////////////////////////
CString::~CString()
{
	free(m_pszString);
	m_pszString = NULL;
}

/////////////////////////////////////////////////////////////////////////////
// CString
//
/////////////////////////////////////////////////////////////////////////////
const CString& CString::operator =(LPCSTR pszString)
{
	free(m_pszString);
	m_pszString = _strdup(pszString);
	return *this;
}

/////////////////////////////////////////////////////////////////////////////
// CString
//
/////////////////////////////////////////////////////////////////////////////
CString::operator LPCTSTR() const           // as a C string
{
	return m_pszString;
}

/////////////////////////////////////////////////////////////////////////////
// CString
//
/////////////////////////////////////////////////////////////////////////////
BOOL CString::operator ==(LPCSTR pszString)
{
	//Handle the NULL case...
	if(pszString == NULL || m_pszString == NULL)
		return pszString == m_pszString;

	//Otherwise just compare the strings...
	return strcmp(m_pszString, pszString)==0;
}

/////////////////////////////////////////////////////////////////////////////
// CString
//
/////////////////////////////////////////////////////////////////////////////
BOOL CString::operator ==(CString& rCString)
{
	//Handle the NULL case...
	return operator==((LPCTSTR)rCString);
}




/////////////////////////////////////////////////////////////////////////////
// CString
// concatentation operator
//
/////////////////////////////////////////////////////////////////////////////
const CString& CString::operator + (LPCSTR lpsz)
{
	CHAR	*pszNewString = NULL;

	if (!lpsz)
		return *this;

	if (!m_pszString)
		return *this = lpsz;

	SAFE_ALLOC(pszNewString, CHAR, strlen(m_pszString) + strlen(lpsz) + 1);
	strcpy(pszNewString, m_pszString);
	strcat(pszNewString, lpsz);
	SAFE_FREE(m_pszString);
	m_pszString = pszNewString;

CLEANUP:
	return *this;
} // CString::operator + 




/////////////////////////////////////////////////////////////////////////////
// CWString
//
/////////////////////////////////////////////////////////////////////////////
CWString::CWString()
{
	m_pwszString = NULL;
}

/////////////////////////////////////////////////////////////////////////////
// CWString
//
/////////////////////////////////////////////////////////////////////////////
CWString::CWString(CWString &String)
{
	m_pwszString = wcsDuplicate((WCHAR*)(LPCWSTR)String);
} 

/////////////////////////////////////////////////////////////////////////////
// CWString
//
/////////////////////////////////////////////////////////////////////////////
CWString::CWString(LPCWSTR pwszString)
{
	//Delegate
	m_pwszString = wcsDuplicate((WCHAR*)pwszString);
}

/////////////////////////////////////////////////////////////////////////////
// CWString
//
/////////////////////////////////////////////////////////////////////////////
CWString::~CWString()
{
	SAFE_FREE(m_pwszString);
	//free(m_pszString);
	//m_pwszString = NULL;
}

/////////////////////////////////////////////////////////////////////////////
// CWString
//
/////////////////////////////////////////////////////////////////////////////
const CWString& CWString::operator =(LPCWSTR pwszString)
{
	SAFE_FREE(m_pwszString);
	m_pwszString = wcsDuplicate((WCHAR*)pwszString);
	return *this;
}

/////////////////////////////////////////////////////////////////////////////
// CWString
//
/////////////////////////////////////////////////////////////////////////////
const CWString& CWString::operator =(CWString wszString)
{
	SAFE_FREE(m_pwszString);
	m_pwszString = wcsDuplicate((WCHAR*)(LPCWSTR)wszString);
	return *this;
}

/////////////////////////////////////////////////////////////////////////////
// CWString
//
/////////////////////////////////////////////////////////////////////////////
CWString::operator LPCWSTR() const           // as a C string
{
	return m_pwszString;
}

/////////////////////////////////////////////////////////////////////////////
// CWString
//
/////////////////////////////////////////////////////////////////////////////
BOOL CWString::operator ==(LPCWSTR pwszString)
{
	//Handle the NULL case...
	if(pwszString == NULL || m_pwszString == NULL)
		return pwszString == m_pwszString;

	//Otherwise just compare the strings...
	return wcscmp(m_pwszString, pwszString)==0;
}

/////////////////////////////////////////////////////////////////////////////
// CWString
//
/////////////////////////////////////////////////////////////////////////////
BOOL CWString::operator ==(CWString& rCWString)
{
	//Handle the NULL case...
	return operator==((LPCWSTR)rCWString);
}



/////////////////////////////////////////////////////////////////////////////
// CWString
// concatentation operator
//
/////////////////////////////////////////////////////////////////////////////
const CWString& CWString::operator + (LPCWSTR lpwsz)
{
	WCHAR	*pwszNewString = NULL;

	if (!lpwsz)
		return *this;

	if (!m_pwszString)
		return *this = lpwsz;

	SAFE_ALLOC(pwszNewString, WCHAR, wcslen(m_pwszString) + wcslen(lpwsz) + 1);
	wcscpy(pwszNewString, m_pwszString);
	wcscat(pwszNewString, lpwsz);
	SAFE_FREE(m_pwszString);
	m_pwszString = pwszNewString;

CLEANUP:
	return *this;
} // CWString::operator + 




////////////////////////////////////////////////////////////////////////
// ERRORMAP
//
////////////////////////////////////////////////////////////////////////
const static WIDENAMEMAP rgErrorMap[] =
{
	 //System Success
	 VALUE_WCHAR(S_OK),
	 VALUE_WCHAR(S_FALSE),

	 //System Errors
	 VALUE_WCHAR(E_FAIL),
	 VALUE_WCHAR(E_INVALIDARG),
	 VALUE_WCHAR(E_OUTOFMEMORY),
	 VALUE_WCHAR(E_NOINTERFACE),
	 VALUE_WCHAR(REGDB_E_CLASSNOTREG),
	 VALUE_WCHAR(CLASS_E_NOAGGREGATION),
     VALUE_WCHAR(E_UNEXPECTED),
     VALUE_WCHAR(E_NOTIMPL),
     VALUE_WCHAR(E_POINTER),
     VALUE_WCHAR(E_HANDLE),
     VALUE_WCHAR(E_ABORT),
     VALUE_WCHAR(E_ACCESSDENIED),
     VALUE_WCHAR(E_PENDING),
	 VALUE_WCHAR(DISP_E_TYPEMISMATCH),

	 //OLE DB Errors
     VALUE_WCHAR(DB_E_BADACCESSORHANDLE),
     VALUE_WCHAR(DB_E_ROWLIMITEXCEEDED),
     VALUE_WCHAR(DB_E_READONLYACCESSOR),
     VALUE_WCHAR(DB_E_SCHEMAVIOLATION),
     VALUE_WCHAR(DB_E_BADROWHANDLE),
     VALUE_WCHAR(DB_E_OBJECTOPEN),
     VALUE_WCHAR(DB_E_CANTCONVERTVALUE),
     VALUE_WCHAR(DB_E_BADBINDINFO),
     VALUE_WCHAR(DB_SEC_E_PERMISSIONDENIED),
     VALUE_WCHAR(DB_E_NOTAREFERENCECOLUMN),
     VALUE_WCHAR(DB_E_NOCOMMAND),
     VALUE_WCHAR(DB_E_BADBOOKMARK),
     VALUE_WCHAR(DB_E_BADLOCKMODE),
     VALUE_WCHAR(DB_E_PARAMNOTOPTIONAL),
     VALUE_WCHAR(DB_E_BADCOLUMNID),
     VALUE_WCHAR(DB_E_BADRATIO),
     VALUE_WCHAR(DB_E_ERRORSINCOMMAND),
     VALUE_WCHAR(DB_E_CANTCANCEL),
     VALUE_WCHAR(DB_E_DIALECTNOTSUPPORTED),
     VALUE_WCHAR(DB_E_DUPLICATEDATASOURCE),
     VALUE_WCHAR(DB_E_CANNOTRESTART),
     VALUE_WCHAR(DB_E_NOTFOUND),
     VALUE_WCHAR(DB_E_NEWLYINSERTED),
     VALUE_WCHAR(DB_E_UNSUPPORTEDCONVERSION),
     VALUE_WCHAR(DB_E_BADSTARTPOSITION),
     VALUE_WCHAR(DB_E_NOTREENTRANT),
     VALUE_WCHAR(DB_E_ERRORSOCCURRED),
     VALUE_WCHAR(DB_E_NOAGGREGATION),
     VALUE_WCHAR(DB_E_DELETEDROW),
     VALUE_WCHAR(DB_E_CANTFETCHBACKWARDS),
     VALUE_WCHAR(DB_E_ROWSNOTRELEASED),
     VALUE_WCHAR(DB_E_BADSTORAGEFLAG),
     VALUE_WCHAR(DB_E_BADSTATUSVALUE),
     VALUE_WCHAR(DB_E_CANTSCROLLBACKWARDS),
     VALUE_WCHAR(DB_E_MULTIPLESTATEMENTS),
     VALUE_WCHAR(DB_E_INTEGRITYVIOLATION),
     VALUE_WCHAR(DB_E_ABORTLIMITREACHED),
     VALUE_WCHAR(DB_E_DUPLICATEINDEXID),
     VALUE_WCHAR(DB_E_NOINDEX),
     VALUE_WCHAR(DB_E_INDEXINUSE),
     VALUE_WCHAR(DB_E_NOTABLE),
     VALUE_WCHAR(DB_E_CONCURRENCYVIOLATION),
     VALUE_WCHAR(DB_E_BADCOPY),
     VALUE_WCHAR(DB_E_BADPRECISION),
     VALUE_WCHAR(DB_E_BADSCALE),
     VALUE_WCHAR(DB_E_BADID),
     VALUE_WCHAR(DB_E_BADTYPE),
     VALUE_WCHAR(DB_E_DUPLICATECOLUMNID),
     VALUE_WCHAR(DB_E_DUPLICATETABLEID),
     VALUE_WCHAR(DB_E_TABLEINUSE),
     VALUE_WCHAR(DB_E_NOLOCALE),
     VALUE_WCHAR(DB_E_BADRECORDNUM),
     VALUE_WCHAR(DB_E_BOOKMARKSKIPPED),
     VALUE_WCHAR(DB_E_BADPROPERTYVALUE),
     VALUE_WCHAR(DB_E_INVALID),
     VALUE_WCHAR(DB_E_BADACCESSORFLAGS),
     VALUE_WCHAR(DB_E_BADSTORAGEFLAGS),
     VALUE_WCHAR(DB_E_BYREFACCESSORNOTSUPPORTED),
     VALUE_WCHAR(DB_E_NULLACCESSORNOTSUPPORTED),
     VALUE_WCHAR(DB_E_NOTPREPARED),
     VALUE_WCHAR(DB_E_BADACCESSORTYPE),
     VALUE_WCHAR(DB_E_WRITEONLYACCESSOR),
     VALUE_WCHAR(DB_SEC_E_AUTH_FAILED),
     VALUE_WCHAR(DB_E_CANCELED),
     VALUE_WCHAR(DB_E_BADSOURCEHANDLE),
     VALUE_WCHAR(DB_E_PARAMUNAVAILABLE),
     VALUE_WCHAR(DB_E_ALREADYINITIALIZED),
     VALUE_WCHAR(DB_E_NOTSUPPORTED),
     VALUE_WCHAR(DB_E_MAXPENDCHANGESEXCEEDED),
     VALUE_WCHAR(DB_E_BADORDINAL),
     VALUE_WCHAR(DB_E_PENDINGCHANGES),
     VALUE_WCHAR(DB_E_DATAOVERFLOW),
     VALUE_WCHAR(DB_E_BADHRESULT),
     VALUE_WCHAR(DB_E_BADLOOKUPID),
     VALUE_WCHAR(DB_E_BADDYNAMICERRORID),
     VALUE_WCHAR(DB_E_PENDINGINSERT),
     VALUE_WCHAR(DB_E_BADCONVERTFLAG),
	 VALUE_WCHAR(DB_E_NOCONSTRAINT),
	 VALUE_WCHAR(DB_E_BADCONSTRAINTID),

     VALUE_WCHAR(DB_S_ROWLIMITEXCEEDED),
     VALUE_WCHAR(DB_S_COLUMNTYPEMISMATCH),
     VALUE_WCHAR(DB_S_TYPEINFOOVERRIDDEN),
     VALUE_WCHAR(DB_S_BOOKMARKSKIPPED),
     VALUE_WCHAR(DB_S_ENDOFROWSET),
     VALUE_WCHAR(DB_S_COMMANDREEXECUTED),
     VALUE_WCHAR(DB_S_BUFFERFULL),
     VALUE_WCHAR(DB_S_NORESULT),
     VALUE_WCHAR(DB_S_CANTRELEASE),
     VALUE_WCHAR(DB_S_DIALECTIGNORED),
     VALUE_WCHAR(DB_S_UNWANTEDPHASE),
     VALUE_WCHAR(DB_S_UNWANTEDREASON),
     VALUE_WCHAR(DB_S_COLUMNSCHANGED),
     VALUE_WCHAR(DB_S_ERRORSRETURNED),
     VALUE_WCHAR(DB_S_BADROWHANDLE),
     VALUE_WCHAR(DB_S_DELETEDROW),
     VALUE_WCHAR(DB_S_STOPLIMITREACHED),
     VALUE_WCHAR(DB_S_LOCKUPGRADED),
     VALUE_WCHAR(DB_S_PROPERTIESCHANGED),
     VALUE_WCHAR(DB_S_ERRORSOCCURRED),
     VALUE_WCHAR(DB_S_PARAMUNAVAILABLE),
     VALUE_WCHAR(DB_S_MULTIPLECHANGES),

	 //Transactions
	 VALUE_WCHAR(XACT_E_FIRST                    ),
	 VALUE_WCHAR(XACT_E_LAST                     ),
	 VALUE_WCHAR(XACT_S_FIRST                    ),
	 VALUE_WCHAR(XACT_S_LAST                     ),

	 VALUE_WCHAR(XACT_E_ABORTED                  ),
	 VALUE_WCHAR(XACT_E_ALREADYOTHERSINGLEPHASE  ),
	 VALUE_WCHAR(XACT_E_ALREADYINPROGRESS        ),
	 VALUE_WCHAR(XACT_E_CANTRETAIN               ),
	 VALUE_WCHAR(XACT_E_COMMITFAILED             ),
	 VALUE_WCHAR(XACT_E_COMMITPREVENTED          ),
	 VALUE_WCHAR(XACT_E_CONNECTION_DENIED        ),
	 VALUE_WCHAR(XACT_E_CONNECTION_DOWN          ),
	 VALUE_WCHAR(XACT_E_HEURISTICABORT           ),
	 VALUE_WCHAR(XACT_E_HEURISTICCOMMIT          ),
	 VALUE_WCHAR(XACT_E_HEURISTICDAMAGE          ),
	 VALUE_WCHAR(XACT_E_HEURISTICDANGER          ),
	 VALUE_WCHAR(XACT_E_INDOUBT                  ),
	 VALUE_WCHAR(XACT_E_INVALIDCOOKIE            ),
	 VALUE_WCHAR(XACT_E_ISOLATIONLEVEL           ),
	 VALUE_WCHAR(XACT_E_LOGFULL                  ),
	 VALUE_WCHAR(XACT_E_NOASYNC                  ),
	 VALUE_WCHAR(XACT_E_NOENLIST                 ),
	 VALUE_WCHAR(XACT_E_NOIMPORTOBJECT           ),
	 VALUE_WCHAR(XACT_E_NOISORETAIN              ),
	 VALUE_WCHAR(XACT_E_NORESOURCE               ),
	 VALUE_WCHAR(XACT_E_NOTCURRENT               ),
	 VALUE_WCHAR(XACT_E_NOTIMEOUT                ),
	 VALUE_WCHAR(XACT_E_NOTRANSACTION            ),
	 VALUE_WCHAR(XACT_E_NOTSUPPORTED             ),
	 VALUE_WCHAR(XACT_E_REENLISTTIMEOUT          ),
	 VALUE_WCHAR(XACT_E_TMNOTAVAILABLE           ),
	 VALUE_WCHAR(XACT_E_UNKNOWNRMGRID            ),
	 VALUE_WCHAR(XACT_E_WRONGSTATE               ),
	 VALUE_WCHAR(XACT_E_WRONGUOW                 ),
	 VALUE_WCHAR(XACT_E_XTIONEXISTS              ),

	 VALUE_WCHAR(XACT_S_ABORTING                 ),
	 VALUE_WCHAR(XACT_S_ALLNORETAIN              ),
	 VALUE_WCHAR(XACT_S_ASYNC                    ),
	 VALUE_WCHAR(XACT_S_DEFECT                   ),
	 VALUE_WCHAR(XACT_S_OKINFORM                 ),
	 VALUE_WCHAR(XACT_S_MADECHANGESCONTENT       ),
	 VALUE_WCHAR(XACT_S_MADECHANGESINFORM        ),
	 VALUE_WCHAR(XACT_S_READONLY                 ),
	 VALUE_WCHAR(XACT_S_SINGLEPHASE              ),
	 VALUE_WCHAR(XACT_S_SOMENORETAIN             ),

	 //Com Errors
	 VALUE_WCHAR(CO_E_NOTINITIALIZED              ),
	 VALUE_WCHAR(CO_E_ALREADYINITIALIZED          ),
	 VALUE_WCHAR(CO_E_CANTDETERMINECLASS          ),
	 VALUE_WCHAR(CO_E_CLASSSTRING                 ),
	 VALUE_WCHAR(CO_E_IIDSTRING                   ),
	 VALUE_WCHAR(CO_E_APPNOTFOUND                 ),
	 VALUE_WCHAR(CO_E_APPSINGLEUSE                ),
	 VALUE_WCHAR(CO_E_ERRORINAPP                  ),
	 VALUE_WCHAR(CO_E_DLLNOTFOUND                 ),
	 VALUE_WCHAR(CO_E_ERRORINDLL                  ),
	 VALUE_WCHAR(CO_E_WRONGOSFORAPP               ),
	 VALUE_WCHAR(CO_E_OBJNOTREG                   ),
	 VALUE_WCHAR(CO_E_OBJISREG                    ),
	 VALUE_WCHAR(CO_E_OBJNOTCONNECTED             ),
	 VALUE_WCHAR(CO_E_APPDIDNTREG                 ),
	 VALUE_WCHAR(CO_E_RELEASED                    ),

	 //Moniker Errors
	 VALUE_WCHAR(MK_E_CONNECTMANUALLY             ),
	 VALUE_WCHAR(MK_E_EXCEEDEDDEADLINE            ),
	 VALUE_WCHAR(MK_E_NEEDGENERIC                 ),
	 VALUE_WCHAR(MK_E_UNAVAILABLE                 ),
	 VALUE_WCHAR(MK_E_SYNTAX                      ),
	 VALUE_WCHAR(MK_E_NOOBJECT                    ),
	 VALUE_WCHAR(MK_E_INVALIDEXTENSION            ),
	 VALUE_WCHAR(MK_E_INTERMEDIATEINTERFACENOTSUPPORTED ),
	 VALUE_WCHAR(MK_E_NOTBINDABLE                 ),
	 VALUE_WCHAR(MK_E_NOTBOUND                    ),
	 VALUE_WCHAR(MK_E_CANTOPENFILE                ),
	 VALUE_WCHAR(MK_E_MUSTBOTHERUSER              ),
	 VALUE_WCHAR(MK_E_NOINVERSE                   ),
	 VALUE_WCHAR(MK_E_NOSTORAGE                   ),
	 VALUE_WCHAR(MK_E_NOPREFIX                    ),
	 VALUE_WCHAR(MK_E_ENUMERATION_FAILED          ),

};


////////////////////////////////////////////////////////////////////////
// PROPSTATUSMAP
//
////////////////////////////////////////////////////////////////////////
const static WIDENAMEMAP rgPropStatusMap[] =
{
    VALUE_WCHAR(DBPROPSTATUS_OK),
	VALUE_WCHAR(DBPROPSTATUS_NOTSUPPORTED),
	VALUE_WCHAR(DBPROPSTATUS_BADVALUE),
	VALUE_WCHAR(DBPROPSTATUS_BADOPTION),
	VALUE_WCHAR(DBPROPSTATUS_BADCOLUMN),
	VALUE_WCHAR(DBPROPSTATUS_NOTALLSETTABLE),
	VALUE_WCHAR(DBPROPSTATUS_NOTSETTABLE),
	VALUE_WCHAR(DBPROPSTATUS_NOTSET),
	VALUE_WCHAR(DBPROPSTATUS_CONFLICTING),
};


////////////////////////////////////////////////////////////////////////
// STATUSMAP
//
////////////////////////////////////////////////////////////////////////
const static WIDENAMEMAP rgStatusMap[] =
{
    VALUE_WCHAR(DBSTATUS_S_OK	),
	VALUE_WCHAR(DBSTATUS_E_BADACCESSOR	),
	VALUE_WCHAR(DBSTATUS_E_CANTCONVERTVALUE	),
	VALUE_WCHAR(DBSTATUS_S_ISNULL	),
	VALUE_WCHAR(DBSTATUS_S_TRUNCATED	),
	VALUE_WCHAR(DBSTATUS_E_SIGNMISMATCH	),
	VALUE_WCHAR(DBSTATUS_E_DATAOVERFLOW	),
	VALUE_WCHAR(DBSTATUS_E_CANTCREATE	),
	VALUE_WCHAR(DBSTATUS_E_UNAVAILABLE	),
	VALUE_WCHAR(DBSTATUS_E_PERMISSIONDENIED	),
	VALUE_WCHAR(DBSTATUS_E_INTEGRITYVIOLATION	),
	VALUE_WCHAR(DBSTATUS_E_SCHEMAVIOLATION	),
	VALUE_WCHAR(DBSTATUS_E_BADSTATUS	),
	VALUE_WCHAR(DBSTATUS_S_DEFAULT	),
	VALUE_WCHAR(DBSTATUS_S_IGNORE	),
    VALUE_WCHAR(DBSTATUS_E_DOESNOTEXIST	),	
	VALUE_WCHAR(DBSTATUS_E_INVALIDURL	),
	VALUE_WCHAR(DBSTATUS_E_RESOURCELOCKED	),
	VALUE_WCHAR(DBSTATUS_E_RESOURCEEXISTS	),
	VALUE_WCHAR(DBSTATUS_E_CANNOTCOMPLETE	),
	VALUE_WCHAR(DBSTATUS_E_VOLUMENOTFOUND	),
	VALUE_WCHAR(DBSTATUS_E_OUTOFSPACE	),
	VALUE_WCHAR(DBSTATUS_S_CANNOTDELETESOURCE	),
	VALUE_WCHAR(DBSTATUS_E_READONLY	),
	VALUE_WCHAR(DBSTATUS_E_RESOURCEOUTOFSCOPE	),
	VALUE_WCHAR(DBSTATUS_S_ALREADYEXISTS	),

	VALUE_WCHAR(DBSTATUS_E_CANCELED	),
};


////////////////////////////////////////////////////////////////////////
// WCHAR* GetStatusName
//
////////////////////////////////////////////////////////////////////////
WCHAR* GetStatusName(DBSTATUS dwStatus)
{
	return GetMapName((LONG)dwStatus, NUMELEM(rgStatusMap), rgStatusMap);
}

////////////////////////////////////////////////////////////////////////
// WCHAR* GetPropStatusName
//
////////////////////////////////////////////////////////////////////////
WCHAR* GetPropStatusName(DBSTATUS dwStatus)
{
	return GetMapName((LONG)dwStatus, NUMELEM(rgPropStatusMap), rgPropStatusMap);
}


////////////////////////////////////////////////////////////////////////
// DBSTATUS GetStatusValue
//
////////////////////////////////////////////////////////////////////////
DBSTATUS GetStatusValue(WCHAR* pwszName)
{
	return GetMapName(pwszName, NUMELEM(rgStatusMap), rgStatusMap);
}


//////////////////////////////////////////////////////////////////////////
// rgSQLTokens
//
//////////////////////////////////////////////////////////////////////////
const static NAMEMAP rgSQLTokens[] =
{
	VALUE_CHAR(SELECT_INVALIDTBLNAME),
	VALUE_CHAR(SELECT_VALIDATIONORDER),
	VALUE_CHAR(SELECT_ALLFROMTBL),							
	VALUE_CHAR(SELECT_SEARCHABLE),
	VALUE_CHAR(SELECT_UPDATEABLE),
	VALUE_CHAR(SELECT_ABCANDCOLLIST),						
	VALUE_CHAR(SELECT_DISTINCTCOLLISTORDERBY),				
	VALUE_CHAR(SELECT_DISTINCTCOLLIST),				
	VALUE_CHAR(SELECT_REVCOLLIST),							
	VALUE_CHAR(SELECT_COLLISTGROUPBY),						
	VALUE_CHAR(SELECT_INVALIDGROUPBY),						
	VALUE_CHAR(SELECT_COLLISTWHERELASTCOLINSELECT),			
	VALUE_CHAR(SELECT_REVCOLLISTFROMVIEW),					
	VALUE_CHAR(SELECT_COUNT),								
	VALUE_CHAR(SELECT_COLLISTSELECTREVCOLLIST),				
	VALUE_CHAR(SELECT_EMPTYROWSET),							
	VALUE_CHAR(SELECT_COLLISTFROMTBL),						
	VALUE_CHAR(SELECT_COLLISTTBLUNIONTBL),					
	VALUE_CHAR(SELECT_COLLISTORDERBYCOLONECOMPUTE),			
	VALUE_CHAR(SELECT_COLLISTORDERBYCOLONECOMPUTEBY),			
	VALUE_CHAR(SELECT_CROSSPRODUCT),						
	VALUE_CHAR(SELECT_LEFTOUTERJOIN),						
	VALUE_CHAR(SELECT_RIGHTOUTERJOIN),						
	VALUE_CHAR(SELECT_LEFTOUTERJOIN_ESC),						
	VALUE_CHAR(SELECT_RIGHTOUTERJOIN_ESC),
	VALUE_CHAR(SELECT_FROMTBLWITHPARAMS),					
	VALUE_CHAR(SELECT_CHANGECOLNAME),						
	VALUE_CHAR(SELECT_DUPLICATECOLUMNS),					
	VALUE_CHAR(SELECT_REVERSEDUPLICATECOLUMNS),				
	VALUE_CHAR(SELECT_MAXCOLINQUERY),						
	VALUE_CHAR(SELECT_COMPUTEDCOLLIST),						
	VALUE_CHAR(SELECT_UPDATEABLEALLROWS),					
	VALUE_CHAR(SELECT_ORDERBYNUMERIC),						
	VALUE_CHAR(INSERT_1ROW),								
	VALUE_CHAR(INSERT_ROW_WITH_LITERALS),
	VALUE_CHAR(INSERT_ALLWITHPARAMS),						
	VALUE_CHAR(SELECT_ALL_WITH_SEARCHABLE_AND_UPDATEABLE),	
	VALUE_CHAR(SELECT_ALL_WITH_BLOB_AT_END),				
	VALUE_CHAR(NO_QUERY),
	VALUE_CHAR(SELECT_ALL_WITH_FOR_BROWSE),					
	VALUE_CHAR(SELECT_ALL_WITH_FOR_UPDATE),					
	VALUE_CHAR(CREATE_VIEW),
	VALUE_CHAR(DROP_VIEW),
	VALUE_CHAR(CREATE_INDEX),
	VALUE_CHAR(CREATE_INDEX_DESC),
	VALUE_CHAR(DROP_INDEX),
	VALUE_CHAR(ALTER_TABLE_DROP_COLUMN),
	VALUE_CHAR(ALTER_TABLE_ADD),
	VALUE_CHAR(ALTER_TABLE_ADD_EX),
	VALUE_CHAR(SELECT_ROW_WITH_LITERALS),
	VALUE_CHAR(CREATE_PROC),
	VALUE_CHAR(DROP_PROC),
	VALUE_CHAR(EXEC_PROC),
	VALUE_CHAR(DROP_TABLE),
	VALUE_CHAR(SELECT_NO_TABLE),
	VALUE_CHAR(INSERT_NO_TABLE),
	VALUE_CHAR(DEEP_SELECT_SUBTREE),
	VALUE_CHAR(SHALLOW_SCOPED_SELECT),
	VALUE_CHAR(INSERT_INVALID_KEYWORD),								
	VALUE_CHAR(UPDATE_WITH_PARAMS_WHERE),								
};



////////////////////////////////////////////////////////////////////////
// ULONG GetSQLTokenMap
//
////////////////////////////////////////////////////////////////////////
ULONG GetSQLTokenMap(NAMEMAP** prgSQLTokenMap)
{
	*prgSQLTokenMap = (NAMEMAP*)rgSQLTokens;
	return NUMELEM(rgSQLTokens);
}


//////////////////////////////////////////////////////////////////////////
// Defines
//
//////////////////////////////////////////////////////////////////////////
WIDENAMEMAP rgSQLQueryMap[] =
{
	VALUE_WCHAR(SELECT_INVALIDTBLNAME),
	VALUE_WCHAR(SELECT_VALIDATIONORDER),
	VALUE_WCHAR(SELECT_ALLFROMTBL),							
	VALUE_WCHAR(SELECT_SEARCHABLE),
	VALUE_WCHAR(SELECT_UPDATEABLE),
	VALUE_WCHAR(SELECT_ABCANDCOLLIST),						
	VALUE_WCHAR(SELECT_DISTINCTCOLLISTORDERBY),				
	VALUE_WCHAR(SELECT_DISTINCTCOLLIST),				
	VALUE_WCHAR(SELECT_REVCOLLIST),							
	VALUE_WCHAR(SELECT_COLLISTGROUPBY),						
	VALUE_WCHAR(SELECT_INVALIDGROUPBY),						
	VALUE_WCHAR(SELECT_COLLISTWHERELASTCOLINSELECT),			
	VALUE_WCHAR(SELECT_REVCOLLISTFROMVIEW),					
	VALUE_WCHAR(SELECT_COUNT),								
	VALUE_WCHAR(SELECT_COLLISTSELECTREVCOLLIST),				
	VALUE_WCHAR(SELECT_EMPTYROWSET),							
	VALUE_WCHAR(SELECT_COLLISTFROMTBL),						
	VALUE_WCHAR(SELECT_COLLISTTBLUNIONTBL),					
	VALUE_WCHAR(SELECT_COLLISTORDERBYCOLONECOMPUTE),			
	VALUE_WCHAR(SELECT_COLLISTORDERBYCOLONECOMPUTEBY),			
	VALUE_WCHAR(SELECT_CROSSPRODUCT),						
	VALUE_WCHAR(SELECT_LEFTOUTERJOIN),						
	VALUE_WCHAR(SELECT_RIGHTOUTERJOIN),						
	VALUE_WCHAR(SELECT_FROMTBLWITHPARAMS),					
	VALUE_WCHAR(SELECT_CHANGECOLNAME),						
	VALUE_WCHAR(SELECT_DUPLICATECOLUMNS),					
	VALUE_WCHAR(SELECT_REVERSEDUPLICATECOLUMNS),				
	VALUE_WCHAR(SELECT_MAXCOLINQUERY),						
	VALUE_WCHAR(SELECT_COMPUTEDCOLLIST),						
	VALUE_WCHAR(SELECT_UPDATEABLEALLROWS),					
	VALUE_WCHAR(SELECT_ORDERBYNUMERIC),						

	VALUE_WCHAR(SELECT_DBSCHEMA_ASSERTIONS),
	VALUE_WCHAR(SELECT_DBSCHEMA_CATALOGS),					
	VALUE_WCHAR(SELECT_DBSCHEMA_CHARACTER_SETS),				
	VALUE_WCHAR(SELECT_DBSCHEMA_CHECK_CONSTRAINTS),			
	VALUE_WCHAR(SELECT_DBSCHEMA_COLLATIONS),					
	VALUE_WCHAR(SELECT_DBSCHEMA_COLUMN_DOMAIN_USAGE),		
	VALUE_WCHAR(SELECT_DBSCHEMA_COLUMN_PRIVILEGES),			
	VALUE_WCHAR(SELECT_DBSCHEMA_COLUMNS),					
	VALUE_WCHAR(SELECT_DBSCHEMA_CONSTRAINT_COLUMN_USAGE),	
	VALUE_WCHAR(SELECT_DBSCHEMA_CONSTRAINT_TABLE_USAGE),		
	VALUE_WCHAR(SELECT_DBSCHEMA_FOREIGN_KEYS),				
	VALUE_WCHAR(SELECT_DBSCHEMA_INDEXES),					
	VALUE_WCHAR(SELECT_DBSCHEMA_KEY_COLUMN_USAGE),			
	VALUE_WCHAR(SELECT_DBSCHEMA_PRIMARY_KEYS),				
	VALUE_WCHAR(SELECT_DBSCHEMA_PROCEDURE_PARAMETERS),		
	VALUE_WCHAR(SELECT_DBSCHEMA_PROCEDURES),					
	VALUE_WCHAR(SELECT_DBSCHEMA_PROVIDER_TYPES),				
	VALUE_WCHAR(SELECT_DBSCHEMA_REFERENTIAL_CONSTRAINTS),	
	VALUE_WCHAR(SELECT_DBSCHEMA_SCHEMATA),					
	VALUE_WCHAR(SELECT_DBSCHEMA_SQL_LANGUAGES),				
	VALUE_WCHAR(SELECT_DBSCHEMA_STATISTICS),					
	VALUE_WCHAR(SELECT_DBSCHEMA_TABLE_CONSTRAINTS),			
	VALUE_WCHAR(SELECT_DBSCHEMA_TABLE_PRIVILEGES),			
	VALUE_WCHAR(SELECT_DBSCHEMA_TABLE),						
	VALUE_WCHAR(SELECT_DBSCHEMA_TRANSLATIONS),				
	VALUE_WCHAR(SELECT_DBSCHEMA_USAGE_PRIVILEGES),			
	VALUE_WCHAR(SELECT_DBSCHEMA_VIEW_COLUMN_USAGE),			
	VALUE_WCHAR(SELECT_DBSCHEMA_VIEW_TABLE_USAGE),			
	VALUE_WCHAR(SELECT_DBSCHEMA_VIEWS),						

	VALUE_WCHAR(INSERT_1ROW),								
	VALUE_WCHAR(INSERT_ROW_WITH_LITERALS),
	VALUE_WCHAR(INSERT_ALLWITHPARAMS),						
	VALUE_WCHAR(SELECT_ALL_WITH_SEARCHABLE_AND_UPDATEABLE),	
	VALUE_WCHAR(SELECT_ALL_WITH_BLOB_AT_END),				
	VALUE_WCHAR(NO_QUERY),
	VALUE_WCHAR(SELECT_ALL_WITH_FOR_BROWSE),					
	VALUE_WCHAR(SELECT_ALL_WITH_FOR_UPDATE),					

	VALUE_WCHAR(CREATE_VIEW),
	VALUE_WCHAR(DROP_VIEW),
	VALUE_WCHAR(CREATE_INDEX),
	VALUE_WCHAR(CREATE_INDEX_DESC),
	VALUE_WCHAR(DROP_INDEX),
	VALUE_WCHAR(ALTER_TABLE_DROP_COLUMN),
	VALUE_WCHAR(ALTER_TABLE_ADD),
	VALUE_WCHAR(ALTER_TABLE_ADD_EX),
	VALUE_WCHAR(SELECT_ROW_WITH_LITERALS),

	VALUE_WCHAR(USE_ENUMERATOR),
	VALUE_WCHAR(USE_COLUMNSROWSET),

	VALUE_WCHAR(CREATE_PROC),
	VALUE_WCHAR(DROP_PROC),
	VALUE_WCHAR(EXEC_PROC),
	VALUE_WCHAR(DROP_TABLE),
	VALUE_WCHAR(SELECT_NO_TABLE),
	VALUE_WCHAR(INSERT_NO_TABLE),
	VALUE_WCHAR(DEEP_SELECT_SUBTREE),
	VALUE_WCHAR(SHALLOW_SCOPED_SELECT),
	VALUE_WCHAR(INSERT_INVALID_KEYWORD),								
	VALUE_WCHAR(UPDATE_WITH_PARAMS_WHERE),								
};


////////////////////////////////////////////////////////////////////////
// EQUERY GetSQLTokenValue
//
////////////////////////////////////////////////////////////////////////
EQUERY GetSQLTokenValue(WCHAR* pwszName)
{
	if(pwszName == NULL)
		return NO_QUERY;
	
	return (EQUERY)GetMapName(pwszName, NUMELEM(rgSQLQueryMap), rgSQLQueryMap);
}


////////////////////////////////////////////////////////////////////////
// EQUERY GetSQLTokenName
//
////////////////////////////////////////////////////////////////////////
WCHAR* GetSQLTokenName(EQUERY eQuery)
{
	return GetMapName((LONG)eQuery, NUMELEM(rgSQLQueryMap), rgSQLQueryMap);
}


////////////////////////////////////////////////////////////////////////
// rgDBTypes
//
////////////////////////////////////////////////////////////////////////
const static WIDENAMEMAP rgDBTypes[] = 
{
    VALUE_WCHAR(DBTYPE_EMPTY	),
	VALUE_WCHAR(DBTYPE_NULL	),
	VALUE_WCHAR(DBTYPE_I2	),
	VALUE_WCHAR(DBTYPE_I4	),
	VALUE_WCHAR(DBTYPE_R4	),
	VALUE_WCHAR(DBTYPE_R8	),
	VALUE_WCHAR(DBTYPE_CY	),
	VALUE_WCHAR(DBTYPE_DATE	),
	VALUE_WCHAR(DBTYPE_BSTR	),
	VALUE_WCHAR(DBTYPE_IDISPATCH	),
	VALUE_WCHAR(DBTYPE_ERROR	),
	VALUE_WCHAR(DBTYPE_BOOL	),
	VALUE_WCHAR(DBTYPE_VARIANT	),
	VALUE_WCHAR(DBTYPE_IUNKNOWN	),
	VALUE_WCHAR(DBTYPE_DECIMAL	),
	VALUE_WCHAR(DBTYPE_UI1	),
	VALUE_WCHAR(DBTYPE_ARRAY	),
	VALUE_WCHAR(DBTYPE_BYREF	),
	VALUE_WCHAR(DBTYPE_I1	),
	VALUE_WCHAR(DBTYPE_UI2	),
	VALUE_WCHAR(DBTYPE_UI4	),
	VALUE_WCHAR(DBTYPE_I8	),
	VALUE_WCHAR(DBTYPE_UI8	),
	VALUE_WCHAR(DBTYPE_GUID	),
	VALUE_WCHAR(DBTYPE_VECTOR	),
	VALUE_WCHAR(DBTYPE_RESERVED	),
	VALUE_WCHAR(DBTYPE_BYTES	),
	VALUE_WCHAR(DBTYPE_STR	),
	VALUE_WCHAR(DBTYPE_WSTR	),
	VALUE_WCHAR(DBTYPE_NUMERIC	),
	VALUE_WCHAR(DBTYPE_UDT	),
	VALUE_WCHAR(DBTYPE_DBDATE	),
	VALUE_WCHAR(DBTYPE_DBTIME	),
	VALUE_WCHAR(DBTYPE_DBTIMESTAMP	),
	VALUE_WCHAR(DBTYPE_HCHAPTER),
	VALUE_WCHAR(DBTYPE_FILETIME	),
	VALUE_WCHAR(DBTYPE_PROPVARIANT	),
	VALUE_WCHAR(DBTYPE_VARNUMERIC	),
};


/////////////////////////////////////////////////////////////////////////////
// WCHAR* GetDBTypeName
//
/////////////////////////////////////////////////////////////////////////////
WCHAR* GetDBTypeName(DBTYPE wType)
{
	return GetMapName(wType, NUMELEM(rgDBTypes), rgDBTypes);
}


/////////////////////////////////////////////////////////////////////////////
// DBTYPE GetDBType
//
/////////////////////////////////////////////////////////////////////////////
DBTYPE GetDBType(WCHAR* pwsz)
{
	return (DBTYPE)GetMapName(pwsz, NUMELEM(rgDBTypes), rgDBTypes);
}



////////////////////////////////////////////////////////////////////////
// PROPSET
//
////////////////////////////////////////////////////////////////////////
const static WIDEGUIDMAP rgPropSetMap[] =
{
	//Property Sets
	& VALUE_WCHAR(DBPROPSET_DATASOURCE),
	& VALUE_WCHAR(DBPROPSET_DATASOURCEINFO),
	& VALUE_WCHAR(DBPROPSET_DBINIT),
	& VALUE_WCHAR(DBPROPSET_INDEX),
	& VALUE_WCHAR(DBPROPSET_ROWSET),
	& VALUE_WCHAR(DBPROPSET_TABLE),
	& VALUE_WCHAR(DBPROPSET_DATASOURCEALL),
	& VALUE_WCHAR(DBPROPSET_DATASOURCEINFOALL),
	& VALUE_WCHAR(DBPROPSET_ROWSETALL),
	& VALUE_WCHAR(DBPROPSET_SESSION),
	& VALUE_WCHAR(DBPROPSET_SESSIONALL),
	& VALUE_WCHAR(DBPROPSET_DBINITALL),
	& VALUE_WCHAR(DBPROPSET_COLUMNALL),
	& VALUE_WCHAR(DBPROPSET_INDEXALL),
	& VALUE_WCHAR(DBPROPSET_TABLEALL),
	& VALUE_WCHAR(DBPROPSET_TRUSTEEALL),
	& VALUE_WCHAR(DBPROPSET_CONSTRAINTALL),
	& VALUE_WCHAR(DBPROPSET_PROPERTIESINERROR),
};


////////////////////////////////////////////////////////////////////////
// PROPMAP
//
////////////////////////////////////////////////////////////////////////
const static WIDENAMEMAP rgOLEDBPropMap[] =
{
	//DBPROPSET_COLUMN
		VALUE_WCHAR(DBPROP_COL_AUTOINCREMENT),     //			DBPROPFLAGS_COLUMN,			DBTYPE_BOOL,		{0,0,0,0,0},
		VALUE_WCHAR(DBPROP_COL_DEFAULT	),     //				DBPROPFLAGS_COLUMN,			DBTYPE_EMPTY,		{0,0,0,0,0},
		VALUE_WCHAR(DBPROP_COL_DESCRIPTION	),     //			DBPROPFLAGS_COLUMN,			DBTYPE_BSTR,		{0,0,0,0,0},
		VALUE_WCHAR(DBPROP_COL_FIXEDLENGTH	),     //			DBPROPFLAGS_COLUMN,			DBTYPE_BOOL,		{0,0,0,0,0},
		VALUE_WCHAR(DBPROP_COL_INCREMENT),     //				DBPROPFLAGS_COLUMN,			DBTYPE_EMPTY,		{0,0,0,0,0},
		VALUE_WCHAR(DBPROP_COL_ISLONG),     //					DBPROPFLAGS_COLUMN,			DBTYPE_BOOL,		{0,0,0,0,0},
		VALUE_WCHAR(DBPROP_COL_NULLABLE	),     //				DBPROPFLAGS_COLUMN,			DBTYPE_BOOL,		{0,0,0,0,0},
		VALUE_WCHAR(DBPROP_COL_PRIMARYKEY	),     //			DBPROPFLAGS_COLUMN,			DBTYPE_BOOL,		{0,0,0,0,0},
		VALUE_WCHAR(DBPROP_COL_UNIQUE	),     //				DBPROPFLAGS_COLUMN,			DBTYPE_BOOL,		{0,0,0,0,0},
		VALUE_WCHAR(DBPROP_COLUMNLCID),     //					DBPROPFLAGS_COLUMN,			DBTYPE_BOOL,		{0,0,0,0,0},
		VALUE_WCHAR(DBPROP_COL_SEED),     //					DBPROPFLAGS_COLUMN,			DBTYPE_EMPTY,		{0,0,0,0,0},

	//DBPROPSET_DATASOURCE
		VALUE_WCHAR(DBPROP_CURRENTCATALOG	),     //			DBPROPFLAGS_DATASOURCE,		DBTYPE_BSTR,		{0,0,0,0,0},
		VALUE_WCHAR(DBPROP_MULTIPLECONNECTIONS),     //		DBPROPFLAGS_DATASOURCE,		DBTYPE_BOOL,		{0,0,0,0,0},
		VALUE_WCHAR(DBPROP_RESETDATASOURCE),     //			DBPROPFLAGS_DATASOURCE,		DBTYPE_I4,			{0,0,0,0,0},

	//DBPROPSET_DATASOURCEINFO
		VALUE_WCHAR(DBPROP_ACTIVESESSIONS	),     //			DBPROPFLAGS_DATASOURCEINFO,	DBTYPE_I4,			{0,0,0,0,0},
		VALUE_WCHAR(DBPROP_ALTERCOLUMN),     //				DBPROPFLAGS_DATASOURCEINFO,	DBTYPE_I4,			{0,0,0,0,0},
		VALUE_WCHAR(DBPROP_ASYNCTXNABORT	),     //			DBPROPFLAGS_DATASOURCEINFO,	DBTYPE_BOOL,		{0,0,0,0,0},
		VALUE_WCHAR(DBPROP_ASYNCTXNCOMMIT	),     //			DBPROPFLAGS_DATASOURCEINFO,	DBTYPE_BOOL,		{0,0,0,0,0},
		VALUE_WCHAR(DBPROP_BYREFACCESSORS	),     //			DBPROPFLAGS_DATASOURCEINFO,	DBTYPE_BOOL,		{0,0,0,0,0},
		VALUE_WCHAR(DBPROP_CATALOGLOCATION	),     //			DBPROPFLAGS_DATASOURCEINFO,	DBTYPE_I4,			{0,0,0,0,0},
		VALUE_WCHAR(DBPROP_CATALOGTERM	),     //				DBPROPFLAGS_DATASOURCEINFO,	DBTYPE_BSTR,		{0,0,0,0,0},
		VALUE_WCHAR(DBPROP_CATALOGUSAGE	),     //				DBPROPFLAGS_DATASOURCEINFO,	DBTYPE_I4,			{0,0,0,0,0},
		VALUE_WCHAR(DBPROP_COLUMNDEFINITION	),     //			DBPROPFLAGS_DATASOURCEINFO,	DBTYPE_I4,			{0,0,0,0,0},
		VALUE_WCHAR(DBPROP_COMSERVICES	),     //				DBPROPFLAGS_DATASOURCEINFO,	DBTYPE_I4,			{0,0,0,0,0},
		VALUE_WCHAR(DBPROP_CONCATNULLBEHAVIOR	),     //		DBPROPFLAGS_DATASOURCEINFO,	DBTYPE_I4,			{0,0,0,0,0},
		VALUE_WCHAR(DBPROP_CONNECTIONSTATUS),     //			DBPROPFLAGS_DATASOURCEINFO,	DBTYPE_I4,			{0,0,0,0,0},
		VALUE_WCHAR(DBPROP_DATASOURCENAME	),     //			DBPROPFLAGS_DATASOURCEINFO,	DBTYPE_BSTR,		{0,0,0,0,0},
		VALUE_WCHAR(DBPROP_DATASOURCEREADONLY	),     //		DBPROPFLAGS_DATASOURCEINFO,	DBTYPE_BOOL,		{0,0,0,0,0},
		VALUE_WCHAR(DBPROP_DATASOURCE_TYPE),     //			DBPROPFLAGS_DATASOURCEINFO,	DBTYPE_I4,			{0,0,0,0,0},
		VALUE_WCHAR(DBPROP_DBMSNAME	),     //					DBPROPFLAGS_DATASOURCEINFO,	DBTYPE_BSTR,		{0,0,0,0,0},
		VALUE_WCHAR(DBPROP_DBMSVER	),     //					DBPROPFLAGS_DATASOURCEINFO,	DBTYPE_BSTR,		{0,0,0,0,0},
		VALUE_WCHAR(DBPROP_DSOTHREADMODEL	),     //			DBPROPFLAGS_DATASOURCEINFO,	DBTYPE_I4,			{0,0,0,0,0},
		VALUE_WCHAR(DBPROP_GENERATEURL),     //				DBPROPFLAGS_DATASOURCEINFO,	DBTYPE_I4,			{0,0,0,0,0},
		VALUE_WCHAR(DBPROP_GROUPBY	),     //					DBPROPFLAGS_DATASOURCEINFO,	DBTYPE_I4,			{0,0,0,0,0},
		VALUE_WCHAR(DBPROP_HETEROGENEOUSTABLES	),     //		DBPROPFLAGS_DATASOURCEINFO,	DBTYPE_I4,			{0,0,0,0,0},
		VALUE_WCHAR(DBPROP_IDENTIFIERCASE),     //				DBPROPFLAGS_DATASOURCEINFO,	DBTYPE_I4,			{0,0,0,0,0},
		VALUE_WCHAR(DBPROP_MAXINDEXSIZE	),     //				DBPROPFLAGS_DATASOURCEINFO,	DBTYPE_I4,			{0,0,0,0,0},
		VALUE_WCHAR(DBPROP_MAXOPENCHAPTERS	),     //			DBPROPFLAGS_DATASOURCEINFO,	DBTYPE_I4,			{0,0,0,0,0},
		VALUE_WCHAR(DBPROP_MAXROWSIZE	),     //				DBPROPFLAGS_DATASOURCEINFO,	DBTYPE_I4,			{0,0,0,0,0},
		VALUE_WCHAR(DBPROP_MAXROWSIZEINCLUDESBLOB	),     //	DBPROPFLAGS_DATASOURCEINFO,	DBTYPE_BOOL,		{0,0,0,0,0},
		VALUE_WCHAR(DBPROP_MAXTABLESINSELECT	),     //		DBPROPFLAGS_DATASOURCEINFO,	DBTYPE_I4,			{0,0,0,0,0},
		VALUE_WCHAR(DBPROP_MULTIPLEPARAMSETS	),     //		DBPROPFLAGS_DATASOURCEINFO,	DBTYPE_BOOL,		{0,0,0,0,0},
		VALUE_WCHAR(DBPROP_MULTIPLERESULTS	),     //			DBPROPFLAGS_DATASOURCEINFO,	DBTYPE_I4,			{0,0,0,0,0},
		VALUE_WCHAR(DBPROP_MULTIPLESTORAGEOBJECTS	),     //	DBPROPFLAGS_DATASOURCEINFO,	DBTYPE_BOOL,		{0,0,0,0,0},	
		VALUE_WCHAR(DBPROP_MULTITABLEUPDATE	),     //			DBPROPFLAGS_DATASOURCEINFO,	DBTYPE_BOOL,		{0,0,0,0,0},
		VALUE_WCHAR(DBPROP_NULLCOLLATION	),     //			DBPROPFLAGS_DATASOURCEINFO,	DBTYPE_I4,			{0,0,0,0,0},
		VALUE_WCHAR(DBPROP_OLEOBJECTS	),     //				DBPROPFLAGS_DATASOURCEINFO,	DBTYPE_I4,			{0,0,0,0,0},
		VALUE_WCHAR(DBPROP_OPENROWSETSUPPORT),     //			DBPROPFLAGS_DATASOURCEINFO,	DBTYPE_I4,			{0,0,0,0,0},	
		VALUE_WCHAR(DBPROP_ORDERBYCOLUMNSINSELECT	),     //	DBPROPFLAGS_DATASOURCEINFO,	DBTYPE_BOOL,		{0,0,0,0,0},
		VALUE_WCHAR(DBPROP_OUTPUTPARAMETERAVAILABILITY	),     //	DBPROPFLAGS_DATASOURCEINFO,	DBTYPE_I4,		{0,0,0,0,0},
		VALUE_WCHAR(DBPROP_PERSISTENTIDTYPE	),     //			DBPROPFLAGS_DATASOURCEINFO,	DBTYPE_I4,			{0,0,0,0,0},
		VALUE_WCHAR(DBPROP_PREPAREABORTBEHAVIOR	),     //		DBPROPFLAGS_DATASOURCEINFO,	DBTYPE_I4,			{0,0,0,0,0},
		VALUE_WCHAR(DBPROP_PREPARECOMMITBEHAVIOR	),     //	DBPROPFLAGS_DATASOURCEINFO,	DBTYPE_I4,			{0,0,0,0,0},
		VALUE_WCHAR(DBPROP_PROCEDURETERM	),     //			DBPROPFLAGS_DATASOURCEINFO,	DBTYPE_BSTR,		{0,0,0,0,0},
		VALUE_WCHAR(DBPROP_PROVIDERFRIENDLYNAME),     //		DBPROPFLAGS_DATASOURCEINFO,	DBTYPE_BSTR,		{0,0,0,0,0},
		VALUE_WCHAR(DBPROP_PROVIDERMEMORY),     //				DBPROPFLAGS_DATASOURCEINFO,	DBTYPE_BOOL,		{0,0,0,0,0},	
		VALUE_WCHAR(DBPROP_PROVIDERFILENAME	),     //			DBPROPFLAGS_DATASOURCEINFO,	DBTYPE_BSTR,		{0,0,0,0,0},
		VALUE_WCHAR(DBPROP_PROVIDEROLEDBVER	),     //			DBPROPFLAGS_DATASOURCEINFO,	DBTYPE_BSTR,		{0,0,0,0,0},
		VALUE_WCHAR(DBPROP_PROVIDERVER	),     //				DBPROPFLAGS_DATASOURCEINFO,	DBTYPE_BSTR,		{0,0,0,0,0},
		VALUE_WCHAR(DBPROP_QUOTEDIDENTIFIERCASE	),     //		DBPROPFLAGS_DATASOURCEINFO,	DBTYPE_I4,			{0,0,0,0,0},
		VALUE_WCHAR(DBPROP_ROWSETCONVERSIONSONCOMMAND	),     //	DBPROPFLAGS_DATASOURCEINFO,	DBTYPE_BOOL,		{0,0,0,0,0},
		VALUE_WCHAR(DBPROP_SCHEMATERM	),     //				DBPROPFLAGS_DATASOURCEINFO,	DBTYPE_BSTR,		{0,0,0,0,0},
		VALUE_WCHAR(DBPROP_SCHEMAUSAGE	),     //				DBPROPFLAGS_DATASOURCEINFO,	DBTYPE_I4,			{0,0,0,0,0},
		VALUE_WCHAR(DBPROP_SERVERNAME),     //					DBPROPFLAGS_DATASOURCEINFO,	DBTYPE_BSTR,		{0,0,0,0,0},	
		VALUE_WCHAR(DBPROP_SQLSUPPORT	),     //				DBPROPFLAGS_DATASOURCEINFO,	DBTYPE_I4,			{0,0,0,0,0},
		VALUE_WCHAR(DBPROP_STRUCTUREDSTORAGE	),     //		DBPROPFLAGS_DATASOURCEINFO,	DBTYPE_I4,			{0,0,0,0,0},
		VALUE_WCHAR(DBPROP_SUBQUERIES	),     //				DBPROPFLAGS_DATASOURCEINFO,	DBTYPE_I4,			{0,0,0,0,0},
		VALUE_WCHAR(DBPROP_SUPPORTEDTXNDDL	),     //			DBPROPFLAGS_DATASOURCEINFO,	DBTYPE_I4,			{0,0,0,0,0},
		VALUE_WCHAR(DBPROP_SUPPORTEDTXNISOLEVELS	),     //	DBPROPFLAGS_DATASOURCEINFO,	DBTYPE_I4,			{0,0,0,0,0},
		VALUE_WCHAR(DBPROP_SUPPORTEDTXNISORETAIN	),     //	DBPROPFLAGS_DATASOURCEINFO,	DBTYPE_I4,			{0,0,0,0,0},
		VALUE_WCHAR(DBPROP_TABLETERM	),     //				DBPROPFLAGS_DATASOURCEINFO,	DBTYPE_BSTR,		{0,0,0,0,0},
		VALUE_WCHAR(DBPROP_USERNAME	),     //					DBPROPFLAGS_DATASOURCEINFO,	DBTYPE_BSTR,		{0,0,0,0,0},
	
		//OLAP Documention
		VALUE_WCHAR(MDPROP_AXES),     //						DBPROPFLAGS_DATASOURCEINFO,	DBTYPE_BOOL,		{0,0,0,0,0},
		VALUE_WCHAR(MDPROP_FLATTENING_SUPPORT),     //			DBPROPFLAGS_DATASOURCEINFO,	DBTYPE_BOOL,		{0,0,0,0,0},
		VALUE_WCHAR(MDPROP_MDX_JOINCUBES),     //				DBPROPFLAGS_DATASOURCEINFO,	DBTYPE_BOOL,		{0,0,0,0,0},
		VALUE_WCHAR(MDPROP_NAMED_LEVELS),     //				DBPROPFLAGS_DATASOURCEINFO,	DBTYPE_BOOL,		{0,0,0,0,0},
		VALUE_WCHAR(MDPROP_RANGEROWSET),     //				DBPROPFLAGS_DATASOURCEINFO,	DBTYPE_BOOL,		{0,0,0,0,0},
		VALUE_WCHAR(MDPROP_MDX_SLICER),     //					DBPROPFLAGS_DATASOURCEINFO,	DBTYPE_BOOL,		{0,0,0,0,0},
		VALUE_WCHAR(MDPROP_MDX_CUBEQUALIFICATION),     //		DBPROPFLAGS_DATASOURCEINFO,	DBTYPE_BOOL,		{0,0,0,0,0},
		VALUE_WCHAR(MDPROP_MDX_OUTERREFERENCE),     //			DBPROPFLAGS_DATASOURCEINFO,	DBTYPE_BOOL,		{0,0,0,0,0},
		VALUE_WCHAR(MDPROP_MDX_QUERYBYPROPERTY),     //		DBPROPFLAGS_DATASOURCEINFO,	DBTYPE_BOOL,		{0,0,0,0,0},
		VALUE_WCHAR(MDPROP_MDX_CASESUPPORT),     //			DBPROPFLAGS_DATASOURCEINFO,	DBTYPE_BOOL,		{0,0,0,0,0},
		VALUE_WCHAR(MDPROP_MDX_STRING_COMPOP),     //			DBPROPFLAGS_DATASOURCEINFO,	DBTYPE_BOOL,		{0,0,0,0,0},
		VALUE_WCHAR(MDPROP_MDX_DESCFLAGS),     //				DBPROPFLAGS_DATASOURCEINFO,	DBTYPE_BOOL,		{0,0,0,0,0},
		VALUE_WCHAR(MDPROP_MDX_SET_FUNCTIONS),     //			DBPROPFLAGS_DATASOURCEINFO,	DBTYPE_BOOL,		{0,0,0,0,0},
		VALUE_WCHAR(MDPROP_MDX_MEMBER_FUNCTIONS),     //		DBPROPFLAGS_DATASOURCEINFO,	DBTYPE_BOOL,		{0,0,0,0,0},
		VALUE_WCHAR(MDPROP_MDX_NUMERIC_FUNCTIONS),     //		DBPROPFLAGS_DATASOURCEINFO,	DBTYPE_BOOL,		{0,0,0,0,0},
		VALUE_WCHAR(MDPROP_MDX_FORMULAS),     //				DBPROPFLAGS_DATASOURCEINFO,	DBTYPE_BOOL,		{0,0,0,0,0},
		VALUE_WCHAR(MDPROP_MDX_AGGREGATECELL_UPDATE),     //	DBPROPFLAGS_DATASOURCEINFO,	DBTYPE_BOOL,		{0,0,0,0,0},	

		//Not yet doc'd...
		VALUE_WCHAR(DBPROP_STORAGEFLAGS),     //				DBPROPFLAGS_DATASOURCEINFO,	DBTYPE_BOOL,		{0,0,0,0,0},

	//DBPROPSET_INDEX
		VALUE_WCHAR(DBPROP_INDEX_AUTOUPDATE),     //			DBPROPFLAGS_INDEX,			DBTYPE_BOOL,		{0,0,0,0,0},
		VALUE_WCHAR(DBPROP_INDEX_CLUSTERED),     //			DBPROPFLAGS_INDEX,			DBTYPE_BOOL,		{0,0,0,0,0},
		VALUE_WCHAR(DBPROP_INDEX_FILLFACTOR),     //			DBPROPFLAGS_INDEX,			DBTYPE_I4,			{0,0,0,0,0},
		VALUE_WCHAR(DBPROP_INDEX_INITIALSIZE),     //			DBPROPFLAGS_INDEX,			DBTYPE_I4,			{0,0,0,0,0},
		VALUE_WCHAR(DBPROP_INDEX_NULLCOLLATION),     //		DBPROPFLAGS_INDEX,			DBTYPE_I4,			{0,0,0,0,0},
		VALUE_WCHAR(DBPROP_INDEX_NULLS),     //				DBPROPFLAGS_INDEX,			DBTYPE_I4,			{0,0,0,0,0},
		VALUE_WCHAR(DBPROP_INDEX_PRIMARYKEY),     //			DBPROPFLAGS_INDEX,			DBTYPE_BOOL,		{0,0,0,0,0},
		VALUE_WCHAR(DBPROP_INDEX_SORTBOOKMARKS),     //		DBPROPFLAGS_INDEX,			DBTYPE_BOOL,		{0,0,0,0,0},
		VALUE_WCHAR(DBPROP_INDEX_TEMPINDEX),     //			DBPROPFLAGS_INDEX,			DBTYPE_BOOL,		{0,0,0,0,0},
		VALUE_WCHAR(DBPROP_INDEX_TYPE),     //					DBPROPFLAGS_INDEX,			DBTYPE_I4,			{0,0,0,0,0},
		VALUE_WCHAR(DBPROP_INDEX_UNIQUE),     //				DBPROPFLAGS_INDEX,			DBTYPE_BOOL,		{0,0,0,0,0},

	//DBPROPSET_DBINIT
		VALUE_WCHAR(DBPROP_AUTH_CACHE_AUTHINFO	),     //		DBPROPFLAGS_DBINIT,			DBTYPE_BOOL,		{0,0,0,0,0},
		VALUE_WCHAR(DBPROP_AUTH_ENCRYPT_PASSWORD	),     //	DBPROPFLAGS_DBINIT,			DBTYPE_BOOL,		{0,0,0,0,0},
		VALUE_WCHAR(DBPROP_AUTH_INTEGRATED	),     //			DBPROPFLAGS_DBINIT,			DBTYPE_BSTR,		{0,0,0,0,0},
		VALUE_WCHAR(DBPROP_AUTH_MASK_PASSWORD	),     //		DBPROPFLAGS_DBINIT,			DBTYPE_BOOL,		{0,0,0,0,0},
		VALUE_WCHAR(DBPROP_AUTH_PASSWORD	),     //			DBPROPFLAGS_DBINIT,			DBTYPE_BSTR,		{0,0,0,0,0},
		VALUE_WCHAR(DBPROP_AUTH_PERSIST_ENCRYPTED	),     //	DBPROPFLAGS_DBINIT,			DBTYPE_BOOL,		{0,0,0,0,0},	
		VALUE_WCHAR(DBPROP_AUTH_PERSIST_SENSITIVE_AUTHINFO	),     //		DBPROPFLAGS_DBINIT,			DBTYPE_BOOL,		{0,0,0,0,0},
		VALUE_WCHAR(DBPROP_AUTH_USERID	),     //				DBPROPFLAGS_DBINIT,			DBTYPE_BSTR,		{0,0,0,0,0},
		VALUE_WCHAR(DBPROP_INIT_ASYNCH),     //				DBPROPFLAGS_DBINIT,			DBTYPE_I4,			{0,0,0,0,0},
		VALUE_WCHAR(DBPROP_INIT_BINDFLAGS),     //				DBPROPFLAGS_DBINIT,			DBTYPE_I4,			{0,0,0,0,0},
		VALUE_WCHAR(DBPROP_INIT_CATALOG),     //				DBPROPFLAGS_DBINIT,			DBTYPE_BSTR,		{0,0,0,0,0},
		VALUE_WCHAR(DBPROP_INIT_DATASOURCE),     //			DBPROPFLAGS_DBINIT,			DBTYPE_BSTR,		{0,0,0,0,0},
		VALUE_WCHAR(DBPROP_INIT_GENERALTIMEOUT),     //		DBPROPFLAGS_DBINIT,			DBTYPE_I4,			{0,0,0,0,0},
		VALUE_WCHAR(DBPROP_INIT_HWND	),     //				DBPROPFLAGS_DBINIT,			DBTYPE_I4,			{0,0,0,0,0},
		VALUE_WCHAR(DBPROP_INIT_IMPERSONATION_LEVEL	),     //	DBPROPFLAGS_DBINIT,			DBTYPE_I4,			{0,0,0,0,0},
		VALUE_WCHAR(DBPROP_INIT_LCID	),     //				DBPROPFLAGS_DBINIT,			DBTYPE_I4,			{0,0,0,0,0},
		VALUE_WCHAR(DBPROP_INIT_LOCATION	),     //			DBPROPFLAGS_DBINIT,			DBTYPE_BSTR,		{0,0,0,0,0},
		VALUE_WCHAR(DBPROP_INIT_LOCKOWNER),     //				DBPROPFLAGS_DBINIT,			DBTYPE_BSTR,		{0,0,0,0,0},
		VALUE_WCHAR(DBPROP_INIT_MODE	),     //				DBPROPFLAGS_DBINIT,			DBTYPE_I4,			{0,0,0,0,0},
		VALUE_WCHAR(DBPROP_INIT_OLEDBSERVICES),     //			DBPROPFLAGS_DBINIT,			DBTYPE_I4,			{0,0,0,0,0},
		VALUE_WCHAR(DBPROP_INIT_PROMPT	),     //				DBPROPFLAGS_DBINIT,			DBTYPE_I2,			{0,0,0,0,0},
		VALUE_WCHAR(DBPROP_INIT_PROTECTION_LEVEL	),     //	DBPROPFLAGS_DBINIT,			DBTYPE_I4,			{0,0,0,0,0},
		VALUE_WCHAR(DBPROP_INIT_PROVIDERSTRING	),     //		DBPROPFLAGS_DBINIT,			DBTYPE_BSTR,		{0,0,0,0,0},
		VALUE_WCHAR(DBPROP_INIT_TIMEOUT	),     //				DBPROPFLAGS_DBINIT,			DBTYPE_I4,			{0,0,0,0,0},

	//DBPROPSET_SESSION
		VALUE_WCHAR(DBPROP_SESS_AUTOCOMMITISOLEVELS	),     //	DBPROPFLAGS_SESSION,		DBTYPE_I4,			{0,0,0,0,0},
	
	//DBPROPSET_TABLE
		VALUE_WCHAR(DBPROP_TBL_TEMPTABLE	),     //			DBPROPFLAGS_TABLE,			DBTYPE_BOOL,		{0,0,0,0,0},

	//DBPROPSET_TRUSTEE
		//Documented in Security Whitepaper
		VALUE_WCHAR(DBPROP_TRUSTEE_USERNAME),     //			DBPROPFLAGS_TRUSTEE,		DBTYPE_BOOL,		{0,0,0,0,0},
		VALUE_WCHAR(DBPROP_TRUSTEE_AUTHENTICATION),     //		DBPROPFLAGS_TRUSTEE,		DBTYPE_BOOL,		{0,0,0,0,0},
		VALUE_WCHAR(DBPROP_TRUSTEE_NEWAUTHENTICATION),     //	DBPROPFLAGS_TRUSTEE,		DBTYPE_BOOL,		{0,0,0,0,0},	

	//DBPROPSET_VIEW
		VALUE_WCHAR(DBPROP_FILTERCOMPAREOPS	),     //			DBPROPFLAGS_VIEW,			DBTYPE_I4,			{0,0,0,0,0},
		VALUE_WCHAR(DBPROP_IAccessor	),     //				DBPROPFLAGS_VIEW,			DBTYPE_BOOL,		{0,0,0,0,0},	
		VALUE_WCHAR(DBPROP_IColumnsInfo	),     //				DBPROPFLAGS_VIEW,			DBTYPE_BOOL,		{0,0,0,0,0},	
		VALUE_WCHAR(DBPROP_ISupportErrorInfo),     //			DBPROPFLAGS_VIEW,			DBTYPE_BOOL,		{0,0,0,0,0},	
		VALUE_WCHAR(DBPROP_IViewChapter),     //				DBPROPFLAGS_VIEW,			DBTYPE_BOOL,		{0,0,0,0,0},	
		VALUE_WCHAR(DBPROP_IViewFilter),     //				DBPROPFLAGS_VIEW,			DBTYPE_BOOL,		{0,0,0,0,0},	
		VALUE_WCHAR(DBPROP_IViewRowset),     //				DBPROPFLAGS_VIEW,			DBTYPE_BOOL,		{0,0,0,0,0},	
		VALUE_WCHAR(DBPROP_IViewSort),     //					DBPROPFLAGS_VIEW,			DBTYPE_BOOL,		{0,0,0,0,0},	
		VALUE_WCHAR(DBPROP_MAXORSINFILTER	),     //			DBPROPFLAGS_VIEW,			DBTYPE_I4,			{0,0,0,0,0},
		VALUE_WCHAR(DBPROP_MAXSORTCOLUMNS	),     //			DBPROPFLAGS_VIEW,			DBTYPE_I4,			{0,0,0,0,0},
		VALUE_WCHAR(DBPROP_SORTONINDEX	),     //				DBPROPFLAGS_VIEW,			DBTYPE_BOOL,		{0,0,0,0,0},

	//DBPROPSET_ROWSET
		VALUE_WCHAR(DBPROP_ABORTPRESERVE	),     //			DBPROPFLAGS_ROWSET,			DBTYPE_BOOL,		{0,0,0,0,0},	
		VALUE_WCHAR(DBPROP_ACCESSORDER),     //				DBPROPFLAGS_ROWSET,			DBTYPE_I4,			{0,0,0,0,0},
		VALUE_WCHAR(DBPROP_APPENDONLY	),     //				DBPROPFLAGS_ROWSET,			DBTYPE_BOOL,		{0,0,0,0,0},
		VALUE_WCHAR(DBPROP_BLOCKINGSTORAGEOBJECTS	),     //	DBPROPFLAGS_ROWSET,			DBTYPE_BOOL,		{0,0,0,0,0},
		VALUE_WCHAR(DBPROP_BOOKMARKINFO),     //				DBPROPFLAGS_ROWSET,			DBTYPE_I4,			{0,0,0,0,0},
		VALUE_WCHAR(DBPROP_BOOKMARKS	),     //				DBPROPFLAGS_ROWSET,			DBTYPE_BOOL,		{0,0,0,0,0},
		VALUE_WCHAR(DBPROP_BOOKMARKSKIPPED	),     //			DBPROPFLAGS_ROWSET,			DBTYPE_BOOL,		{0,0,0,0,0},
		VALUE_WCHAR(DBPROP_BOOKMARKTYPE	),     //				DBPROPFLAGS_ROWSET,			DBTYPE_I4,			{0,0,0,0,0},
		VALUE_WCHAR(DBPROP_CACHEDEFERRED	),     //			DBPROPFLAGS_ROWSET,			DBTYPE_BOOL,		{0,0,0,0,0},
		VALUE_WCHAR(DBPROP_CANFETCHBACKWARDS	),     //		DBPROPFLAGS_ROWSET,			DBTYPE_BOOL,		{0,0,0,0,0},
		VALUE_WCHAR(DBPROP_CANHOLDROWS	),     //				DBPROPFLAGS_ROWSET,			DBTYPE_BOOL,		{0,0,0,0,0},
		VALUE_WCHAR(DBPROP_CANSCROLLBACKWARDS	),     //		DBPROPFLAGS_ROWSET,			DBTYPE_BOOL,		{0,0,0,0,0},
		VALUE_WCHAR(DBPROP_CHANGEINSERTEDROWS	),     //		DBPROPFLAGS_ROWSET,			DBTYPE_BOOL,		{0,0,0,0,0},
		VALUE_WCHAR(DBPROP_CLIENTCURSOR),     //				DBPROPFLAGS_ROWSET,			DBTYPE_BOOL,		{0,0,0,0,0},
		VALUE_WCHAR(DBPROP_COLUMNRESTRICT	),     //			DBPROPFLAGS_ROWSET,			DBTYPE_BOOL,		{0,0,0,0,0},
		VALUE_WCHAR(DBPROP_COMMANDTIMEOUT	),     //			DBPROPFLAGS_ROWSET,			DBTYPE_I4,			{0,0,0,0,0},
		VALUE_WCHAR(DBPROP_COMMITPRESERVE	),     //			DBPROPFLAGS_ROWSET,			DBTYPE_BOOL,		{0,0,0,0,0},
		VALUE_WCHAR(DBPROP_DEFERRED	),     //					DBPROPFLAGS_ROWSET,			DBTYPE_BOOL,		{0,0,0,0,0},
		VALUE_WCHAR(DBPROP_DELAYSTORAGEOBJECTS	),     //		DBPROPFLAGS_ROWSET,			DBTYPE_BOOL,		{0,0,0,0,0},
		VALUE_WCHAR(DBPROP_FINDCOMPAREOPS	),     //			DBPROPFLAGS_ROWSET,			DBTYPE_I4,			{0,0,0,0,0},
		VALUE_WCHAR(DBPROP_HIDDENCOLUMNS),     //				DBPROPFLAGS_ROWSET,			DBTYPE_I4,			{0,0,0,0,0},
		VALUE_WCHAR(DBPROP_IAccessor	),     //				DBPROPFLAGS_ROWSET,			DBTYPE_BOOL,		{0,0,0,0,0},
		VALUE_WCHAR(DBPROP_IChapteredRowset	),     //			DBPROPFLAGS_ROWSET,			DBTYPE_BOOL,		{0,0,0,0,0},
		VALUE_WCHAR(DBPROP_IColumnsInfo	),     //				DBPROPFLAGS_ROWSET,			DBTYPE_BOOL,		{0,0,0,0,0},
		VALUE_WCHAR(DBPROP_IColumnsInfo2),     //				DBPROPFLAGS_ROWSET,			DBTYPE_BOOL,		{0,0,0,0,0},
		VALUE_WCHAR(DBPROP_IColumnsRowset	),     //			DBPROPFLAGS_ROWSET,			DBTYPE_BOOL,		{0,0,0,0,0},
		VALUE_WCHAR(DBPROP_IConnectionPointContainer),     //	DBPROPFLAGS_ROWSET,			DBTYPE_BOOL,		{0,0,0,0,0},
		VALUE_WCHAR(DBPROP_IConvertType	),     //				DBPROPFLAGS_ROWSET,			DBTYPE_BOOL,		{0,0,0,0,0},
		VALUE_WCHAR(DBPROP_ICreateRow),     //					DBPROPFLAGS_ROWSET,			DBTYPE_BOOL,		{0,0,0,0,0},
		VALUE_WCHAR(DBPROP_IDBAsynchStatus	),     //			DBPROPFLAGS_ROWSET,			DBTYPE_BOOL,		{0,0,0,0,0},
		VALUE_WCHAR(DBPROP_IGetRow),     //					DBPROPFLAGS_ROWSET,			DBTYPE_BOOL,		{0,0,0,0,0},
		VALUE_WCHAR(DBPROP_IGetSession),     //				DBPROPFLAGS_ROWSET,			DBTYPE_BOOL,		{0,0,0,0,0},
		VALUE_WCHAR(DBPROP_IGetSourceRow),     //				DBPROPFLAGS_ROWSET,			DBTYPE_BOOL,		{0,0,0,0,0},
		VALUE_WCHAR(DBPROP_ILockBytes),     //					DBPROPFLAGS_ROWSET,			DBTYPE_BOOL,		{0,0,0,0,0},
		VALUE_WCHAR(DBPROP_IMMOBILEROWS),     //				DBPROPFLAGS_ROWSET,			DBTYPE_BOOL,		{0,0,0,0,0},
		VALUE_WCHAR(DBPROP_IMultipleResults),     //			DBPROPFLAGS_ROWSET,			DBTYPE_BOOL,		{0,0,0,0,0},
		VALUE_WCHAR(DBPROP_IParentRowset),     //				DBPROPFLAGS_ROWSET,			DBTYPE_BOOL,		{0,0,0,0,0},	
		VALUE_WCHAR(DBPROP_IRow),     //						DBPROPFLAGS_ROWSET,			DBTYPE_BOOL,		{0,0,0,0,0},
		VALUE_WCHAR(DBPROP_IRowChange),     //					DBPROPFLAGS_ROWSET,			DBTYPE_BOOL,		{0,0,0,0,0},
		VALUE_WCHAR(DBPROP_IRowSchemaChange),     //			DBPROPFLAGS_ROWSET,			DBTYPE_BOOL,		{0,0,0,0,0},
		VALUE_WCHAR(DBPROP_IRowset	),     //					DBPROPFLAGS_ROWSET,			DBTYPE_BOOL,		{0,0,0,0,0},
		VALUE_WCHAR(DBPROP_IRowsetChange	),     //			DBPROPFLAGS_ROWSET,			DBTYPE_BOOL,		{0,0,0,0,0},
		VALUE_WCHAR(DBPROP_IRowsetCurrentIndex),     //		DBPROPFLAGS_ROWSET,			DBTYPE_BOOL,		{0,0,0,0,0},	
		VALUE_WCHAR(DBPROP_IRowsetFind	),     //				DBPROPFLAGS_ROWSET,			DBTYPE_BOOL,		{0,0,0,0,0},
		VALUE_WCHAR(DBPROP_IRowsetIdentity),     //			DBPROPFLAGS_ROWSET,			DBTYPE_BOOL,		{0,0,0,0,0},
		VALUE_WCHAR(DBPROP_IRowsetIndex),     //				DBPROPFLAGS_ROWSET,			DBTYPE_BOOL,		{0,0,0,0,0},
		VALUE_WCHAR(DBPROP_IRowsetInfo),     //				DBPROPFLAGS_ROWSET,			DBTYPE_BOOL,		{0,0,0,0,0},
		VALUE_WCHAR(DBPROP_IRowsetLocate),     //				DBPROPFLAGS_ROWSET,			DBTYPE_BOOL,		{0,0,0,0,0},
		VALUE_WCHAR(DBPROP_IRowsetRefresh),     //				DBPROPFLAGS_ROWSET,			DBTYPE_BOOL,		{0,0,0,0,0},
		VALUE_WCHAR(DBPROP_IRowsetScroll),     //				DBPROPFLAGS_ROWSET,			DBTYPE_BOOL,		{0,0,0,0,0},
		VALUE_WCHAR(DBPROP_IRowsetUpdate),     //				DBPROPFLAGS_ROWSET,			DBTYPE_BOOL,		{0,0,0,0,0},
		VALUE_WCHAR(DBPROP_IRowsetView),     //				DBPROPFLAGS_ROWSET,			DBTYPE_BOOL,		{0,0,0,0,0},
		VALUE_WCHAR(DBPROP_IScopedOperations),     //			DBPROPFLAGS_ROWSET,			DBTYPE_BOOL,		{0,0,0,0,0},
		VALUE_WCHAR(DBPROP_ISequentialStream),     //			DBPROPFLAGS_ROWSET,			DBTYPE_BOOL,		{0,0,0,0,0},
		VALUE_WCHAR(DBPROP_IStorage),     //					DBPROPFLAGS_ROWSET,			DBTYPE_BOOL,		{0,0,0,0,0},
		VALUE_WCHAR(DBPROP_IStream),     //					DBPROPFLAGS_ROWSET,			DBTYPE_BOOL,		{0,0,0,0,0},
		VALUE_WCHAR(DBPROP_ISupportErrorInfo),     //			DBPROPFLAGS_ROWSET,			DBTYPE_BOOL,		{0,0,0,0,0},
		VALUE_WCHAR(DBPROP_LITERALBOOKMARKS	),     //			DBPROPFLAGS_ROWSET,			DBTYPE_BOOL,		{0,0,0,0,0},
		VALUE_WCHAR(DBPROP_LITERALIDENTITY	),     //			DBPROPFLAGS_ROWSET,			DBTYPE_BOOL,		{0,0,0,0,0},
		VALUE_WCHAR(DBPROP_LOCKMODE),     //					DBPROPFLAGS_ROWSET,			DBTYPE_I4,			{0,0,0,0,0},
		VALUE_WCHAR(DBPROP_MAXOPENROWS	),     //				DBPROPFLAGS_ROWSET,			DBTYPE_I4,			{0,0,0,0,0},
		VALUE_WCHAR(DBPROP_MAXPENDINGROWS	),     //			DBPROPFLAGS_ROWSET,			DBTYPE_I4,			{0,0,0,0,0},
		VALUE_WCHAR(DBPROP_MAXROWS	),     //					DBPROPFLAGS_ROWSET,			DBTYPE_I4,			{0,0,0,0,0},
		VALUE_WCHAR(DBPROP_MAYWRITECOLUMN	),     //			DBPROPFLAGS_ROWSET,			DBTYPE_BOOL,		{0,0,0,0,0},
		VALUE_WCHAR(DBPROP_MEMORYUSAGE	),     //				DBPROPFLAGS_ROWSET,			DBTYPE_I4,			{0,0,0,0,0},
		VALUE_WCHAR(DBPROP_NOTIFICATIONGRANULARITY	),     //	DBPROPFLAGS_ROWSET,			DBTYPE_I4,			{0,0,0,0,0},	
		VALUE_WCHAR(DBPROP_NOTIFICATIONPHASES	),     //		DBPROPFLAGS_ROWSET,			DBTYPE_I4,			{0,0,0,0,0},
		VALUE_WCHAR(DBPROP_NOTIFYCOLUMNSET	),     //			DBPROPFLAGS_ROWSET,			DBTYPE_I4,			{0,0,0,0,0},
		VALUE_WCHAR(DBPROP_NOTIFYROWDELETE	),     //			DBPROPFLAGS_ROWSET,			DBTYPE_I4,			{0,0,0,0,0},
		VALUE_WCHAR(DBPROP_NOTIFYROWFIRSTCHANGE	),     //		DBPROPFLAGS_ROWSET,			DBTYPE_I4,			{0,0,0,0,0},
		VALUE_WCHAR(DBPROP_NOTIFYROWINSERT	),     //			DBPROPFLAGS_ROWSET,			DBTYPE_I4,			{0,0,0,0,0},
		VALUE_WCHAR(DBPROP_NOTIFYROWRESYNCH	),     //			DBPROPFLAGS_ROWSET,			DBTYPE_I4,			{0,0,0,0,0},
		VALUE_WCHAR(DBPROP_NOTIFYROWSETRELEASE	),     //		DBPROPFLAGS_ROWSET,			DBTYPE_I4,			{0,0,0,0,0},
		VALUE_WCHAR(DBPROP_NOTIFYROWSETFETCHPOSITIONCHANGE),     //	DBPROPFLAGS_ROWSET,			DBTYPE_I4,		{0,0,0,0,0},
		VALUE_WCHAR(DBPROP_NOTIFYROWUNDOCHANGE	),     //		DBPROPFLAGS_ROWSET,			DBTYPE_I4,			{0,0,0,0,0},
		VALUE_WCHAR(DBPROP_NOTIFYROWUNDODELETE	),     //		DBPROPFLAGS_ROWSET,			DBTYPE_I4,			{0,0,0,0,0},
		VALUE_WCHAR(DBPROP_NOTIFYROWUNDOINSERT	),     //		DBPROPFLAGS_ROWSET,			DBTYPE_I4,			{0,0,0,0,0},
		VALUE_WCHAR(DBPROP_NOTIFYROWUPDATE	),     //			DBPROPFLAGS_ROWSET,			DBTYPE_I4,			{0,0,0,0,0},
		VALUE_WCHAR(DBPROP_ORDEREDBOOKMARKS	),     //			DBPROPFLAGS_ROWSET,			DBTYPE_BOOL,		{0,0,0,0,0},
		VALUE_WCHAR(DBPROP_OTHERINSERT	),     //				DBPROPFLAGS_ROWSET,			DBTYPE_BOOL,		{0,0,0,0,0},
		VALUE_WCHAR(DBPROP_OTHERUPDATEDELETE	),     //		DBPROPFLAGS_ROWSET,			DBTYPE_BOOL,		{0,0,0,0,0},
		VALUE_WCHAR(DBPROP_OWNINSERT	),     //				DBPROPFLAGS_ROWSET,			DBTYPE_BOOL,		{0,0,0,0,0},
		VALUE_WCHAR(DBPROP_OWNUPDATEDELETE	),     //			DBPROPFLAGS_ROWSET,			DBTYPE_BOOL,		{0,0,0,0,0},
		VALUE_WCHAR(DBPROP_QUICKRESTART	),     //				DBPROPFLAGS_ROWSET,			DBTYPE_BOOL,		{0,0,0,0,0},
		VALUE_WCHAR(DBPROP_REENTRANTEVENTS	),     //			DBPROPFLAGS_ROWSET,			DBTYPE_BOOL,		{0,0,0,0,0},
		VALUE_WCHAR(DBPROP_REMOVEDELETED	),     //			DBPROPFLAGS_ROWSET,			DBTYPE_BOOL,		{0,0,0,0,0},
		VALUE_WCHAR(DBPROP_REPORTMULTIPLECHANGES	),     //	DBPROPFLAGS_ROWSET,			DBTYPE_BOOL,		{0,0,0,0,0},	
		VALUE_WCHAR(DBPROP_RETURNPENDINGINSERTS	),     //		DBPROPFLAGS_ROWSET,			DBTYPE_BOOL,		{0,0,0,0,0},
		VALUE_WCHAR(DBPROP_ROW_BULKOPS),     //				DBPROPFLAGS_ROWSET,			DBTYPE_I4,			{0,0,0,0,0},
		VALUE_WCHAR(DBPROP_ROWRESTRICT	),     //				DBPROPFLAGS_ROWSET,			DBTYPE_BOOL,		{0,0,0,0,0},
		VALUE_WCHAR(DBPROP_ROWSET_ASYNCH	),     //			DBPROPFLAGS_ROWSET,			DBTYPE_I4,			{0,0,0,0,0},
		VALUE_WCHAR(DBPROP_ROWTHREADMODEL	),     //			DBPROPFLAGS_ROWSET,			DBTYPE_I4,			{0,0,0,0,0},
		VALUE_WCHAR(DBPROP_SERVERCURSOR	),     //				DBPROPFLAGS_ROWSET,			DBTYPE_BOOL,		{0,0,0,0,0},
		VALUE_WCHAR(DBPROP_SERVERDATAONINSERT),     //			DBPROPFLAGS_ROWSET,			DBTYPE_BOOL,		{0,0,0,0,0},
		VALUE_WCHAR(DBPROP_STRONGIDENTITY	),     //			DBPROPFLAGS_ROWSET,			DBTYPE_BOOL,		{0,0,0,0,0},
		VALUE_WCHAR(DBPROP_TRANSACTEDOBJECT	),     //			DBPROPFLAGS_ROWSET,			DBTYPE_BOOL,		{0,0,0,0,0},
		VALUE_WCHAR(DBPROP_UNIQUEROWS),     //					DBPROPFLAGS_ROWSET,			DBTYPE_BOOL,		{0,0,0,0,0},
		VALUE_WCHAR(DBPROP_UPDATABILITY	),     //				DBPROPFLAGS_ROWSET,			DBTYPE_I4,			{0,0,0,0,0},

		//Currently not doc'd due to known property set...
		VALUE_WCHAR(DBPROP_IBindResource),     //				DBPROPFLAGS_ROWSET,			DBTYPE_BOOL,		{0,0,0,0,0},
		VALUE_WCHAR(DBPROP_IDBBinderProperties),     //		DBPROPFLAGS_ROWSET,			DBTYPE_BOOL,		{0,0,0,0,0},	
		VALUE_WCHAR(DBPROP_IRegisterProvider),     //			DBPROPFLAGS_ROWSET,			DBTYPE_BOOL,		{0,0,0,0,0},	

		//Deprecated Properties
		VALUE_WCHAR(DBPROP_IRowsetResynch),     //				DBPROPFLAGS_ROWSET,			DBTYPE_BOOL,		{0,0,0,0,0},
};


////////////////////////////////////////////////////////////////////////
// PROPFLAGS
//
////////////////////////////////////////////////////////////////////////
const static WIDENAMEMAP rgPropFlagsMap[] =
{
    VALUE_WCHAR(DBPROPFLAGS_NOTSUPPORTED	),
	VALUE_WCHAR(DBPROPFLAGS_COLUMN	),
	VALUE_WCHAR(DBPROPFLAGS_DATASOURCE	),
	VALUE_WCHAR(DBPROPFLAGS_DATASOURCECREATE	),
	VALUE_WCHAR(DBPROPFLAGS_DATASOURCEINFO	),
	VALUE_WCHAR(DBPROPFLAGS_DBINIT	),
	VALUE_WCHAR(DBPROPFLAGS_INDEX	),
	VALUE_WCHAR(DBPROPFLAGS_ROWSET	),
	VALUE_WCHAR(DBPROPFLAGS_TABLE	),
	VALUE_WCHAR(DBPROPFLAGS_COLUMNOK	),
	VALUE_WCHAR(DBPROPFLAGS_READ	),
	VALUE_WCHAR(DBPROPFLAGS_WRITE	),
	VALUE_WCHAR(DBPROPFLAGS_REQUIRED	),
	VALUE_WCHAR(DBPROPFLAGS_SESSION	),
};


////////////////////////////////////////////////////////////////////////
// WCHAR* GetPropertyName
//
////////////////////////////////////////////////////////////////////////
WCHAR* GetPropertyName(DBPROPID dwPropertyID, REFGUID guidPropertySet)
{
	//Thankfully all OLEDB Properties have different DBPROPIDs, (all unique)
	//The problem is that provider specific properties may not be.
	//So if we know the set we can find the property, otherwsie we don't know it...
	if(guidPropertySet == DBPROPSET_COLUMN ||
		guidPropertySet == DBPROPSET_DATASOURCE ||
		guidPropertySet == DBPROPSET_DATASOURCEINFO ||
		guidPropertySet == DBPROPSET_DBINIT ||
		guidPropertySet == DBPROPSET_INDEX || 
		guidPropertySet == DBPROPSET_ROWSET || 
		guidPropertySet == DBPROPSET_TABLE ||
		guidPropertySet == DBPROPSET_DATASOURCEALL ||
		guidPropertySet == DBPROPSET_DATASOURCEINFOALL ||
		guidPropertySet == DBPROPSET_ROWSETALL ||
		guidPropertySet == DBPROPSET_SESSION ||
		guidPropertySet == DBPROPSET_SESSIONALL ||
		guidPropertySet == DBPROPSET_DBINITALL ||
		guidPropertySet == DBPROPSET_PROPERTIESINERROR)
	{
		return GetMapName(dwPropertyID, NUMELEM(rgOLEDBPropMap), rgOLEDBPropMap);
	}

	//Otherwise we have no clue what the property is...
	return NULL;
}


///////////////////////////////////////////////////////////////////
// Static InitPropInfo
//
///////////////////////////////////////////////////////////////////
const static INITPROPINFOMAP g_rgInitPropInfoMap[] = 
{
	//PropertyID							//Type		//InitString					//Description
	DBPROP_AUTH_CACHE_AUTHINFO,				VT_BOOL,	L"CACHE_AUTHINFO",				L"Cache Authentication\0",
	DBPROP_AUTH_ENCRYPT_PASSWORD,			VT_BOOL,	L"ENCRYPT_PASSWORD",			L"Encrypt Password\0",
	DBPROP_AUTH_INTEGRATED,					VT_BSTR,	L"INTEGRATED",					L"Integrated Security\0",
	DBPROP_AUTH_MASK_PASSWORD,				VT_BOOL,	L"MASK_PASSWORD",				L"Mask Password\0",
	DBPROP_AUTH_PASSWORD,					VT_BSTR,	L"PASSWORD",					L"Password\0",
	DBPROP_AUTH_PERSIST_ENCRYPTED,			VT_BOOL,	L"PERSIST_ENCRYPTED",			L"Persist Encrypted\0",
	DBPROP_AUTH_PERSIST_SENSITIVE_AUTHINFO,	VT_BOOL,	L"PERSIST_SENSITIVE_AUTHUNFO",	L"Persist Security Info\0",
	DBPROP_AUTH_USERID,						VT_BSTR,	L"USERID",						L"User ID\0",
	DBPROP_INIT_DATASOURCE,					VT_BSTR,	L"DATASOURCE",					L"Data Source\0",
	DBPROP_INIT_GENERALTIMEOUT,				VT_I4,		L"GENERALTIMEOUT",				L"General Timeout\0",
#ifdef _WIN64
	DBPROP_INIT_HWND,						VT_I8,		L"HWND",						L"Window Handle\0",
#else
	DBPROP_INIT_HWND,						VT_I4,		L"HWND",						L"Window Handle\0",
#endif
	DBPROP_INIT_IMPERSONATION_LEVEL,		VT_I4,		L"IMPERSONATION_LEVEL",			L"Impersonation Level\0",
	DBPROP_INIT_LCID,						VT_I4,		L"LCID",						L"Locale Identifier\0",
	DBPROP_INIT_LOCATION,					VT_BSTR,	L"LOCATION",					L"Location\0",
	DBPROP_INIT_MODE,						VT_I4,		L"MODE",						L"Mode\0",
	DBPROP_INIT_PROMPT,						VT_I2,		L"PROMPT",						L"Prompt\0",
	DBPROP_INIT_PROTECTION_LEVEL,			VT_I4,		L"PROTECTION_LEVEL",			L"Protection Level\0",
	DBPROP_INIT_PROVIDERSTRING,				VT_BSTR,	L"PROVIDERSTRING",				L"Extended Properties\0",
	DBPROP_INIT_TIMEOUT,					VT_I4,		L"TIMEOUT",						L"Connect Timeout\0",
	DBPROP_INIT_ASYNCH,						VT_I4,		L"ASYNCH",						L"Asynchronous Processing\0",
	DBPROP_INIT_CATALOG,					VT_BSTR,	L"CATALOG",					    L"Initial Catalog\0",
	DBPROP_INIT_OLEDBSERVICES,				VT_I4,		L"OLEDBSERVICES",				L"OLE DB Services\0",
	
	//OLEDB2.5
	DBPROP_INIT_LOCKOWNER,					VT_BSTR,	L"LOCKOWNER",					L"Lock Owner\0",
	DBPROP_INIT_BINDFLAGS,					VT_I4,		L"BINDFLAGS",					L"Bind Flags\0",
};
const static ULONG g_cInitPropInfoMap = NUMELEM(g_rgInitPropInfoMap);


////////////////////////////////////////////////////////////////////////
// WCHAR* GetStaticPropDesc
//
////////////////////////////////////////////////////////////////////////
WCHAR* GetStaticPropDesc(DBPROPID dwPropertyID, REFGUID guidPropertySet)
{
	//Currently only handles DBINIT property set...
	if(guidPropertySet != DBPROPSET_DBINIT)
		return NULL;

	for(ULONG i=0; i<g_cInitPropInfoMap; i++)
	{
		if(dwPropertyID == g_rgInitPropInfoMap[i].dwPropertyID) 
			return g_rgInitPropInfoMap[i].pwszDesc;
	}

	return NULL;
}



////////////////////////////////////////////////////////////////////////
// WCHAR* GetPropSetName
//
////////////////////////////////////////////////////////////////////////
WCHAR* GetPropSetName(REFGUID guidPropertySet)
{
	return GetMapName(guidPropertySet, NUMELEM(rgPropSetMap), rgPropSetMap);
}


////////////////////////////////////////////////////////////////////////
// LONG GetMapName
//
////////////////////////////////////////////////////////////////////////
LONG GetMapName(WCHAR* pwsz, ULONG cNameMap, const WIDENAMEMAP* rgNameMap)
{
	ASSERT(pwsz);
	ASSERT(rgNameMap);
	for(ULONG i=0; i<cNameMap; i++)
	{
		if(wcscmp(pwsz, rgNameMap[i].pwszName)==0) 
			return rgNameMap[i].lItem;
	}

	//Otherwise just return last element
	return -1;
}


////////////////////////////////////////////////////////////////////////
// WCHAR* GetMapName
//
////////////////////////////////////////////////////////////////////////
WCHAR* GetMapName(LONG lItem, ULONG cNameMap, const WIDENAMEMAP* rgNameMap)
{
	ASSERT(rgNameMap);
	for(ULONG i=0; i<cNameMap; i++)
	{
		if(lItem == rgNameMap[i].lItem) 
			return rgNameMap[i].pwszName;
	}

	//Otherwise just return last element
	return NULL;
}

////////////////////////////////////////////////////////////////////////
// WCHAR* GetMapName
//
////////////////////////////////////////////////////////////////////////
WCHAR* GetMapName(REFGUID guid, ULONG cGuidMap, const WIDEGUIDMAP* rgGuidMap)
{
	for(ULONG i=0; i<cGuidMap; i++)	
	{
		if(guid == *(rgGuidMap[i].pGuid)) 
			return rgGuidMap[i].pwszName;
	}

	//Otherwise just return last element
	return NULL;
}


////////////////////////////////////////////////////////////////////////
// LONG GetMapName
//
////////////////////////////////////////////////////////////////////////
LONG GetMapName(CHAR* psz, ULONG cNameMap, const NAMEMAP* rgNameMap)
{
	ASSERT(psz);
	ASSERT(rgNameMap);
	for(ULONG i=0; i<cNameMap; i++)
	{
		if(strcmp(psz, rgNameMap[i].pszName)==0) 
			return rgNameMap[i].lItem;
	}

	//Otherwise just return last element
	return -1;
}


////////////////////////////////////////////////////////////////////////
// CHAR* GetMapName
//
////////////////////////////////////////////////////////////////////////
CHAR* GetMapName(LONG lItem, ULONG cNameMap, const NAMEMAP* rgNameMap)
{
	ASSERT(rgNameMap);
	for(ULONG i=0; i<cNameMap; i++)
	{
		if(lItem == rgNameMap[i].lItem) 
			return rgNameMap[i].pszName;
	}

	//Otherwise just return last element
	return NULL;
}


////////////////////////////////////////////////////////////////////////
// CHAR* GetMapName
//
////////////////////////////////////////////////////////////////////////
CHAR* GetMapName(REFGUID guid, ULONG cGuidMap, const GUIDMAP* rgGuidMap)
{
	for(ULONG i=0; i<cGuidMap; i++)	
	{
		if(guid == *(rgGuidMap[i].pGuid)) 
			return rgGuidMap[i].pszName;
	}

	//Otherwise just return last element
	return NULL;
}

////////////////////////////////////////////////////////////////////////
// WCHAR* GetErrorName
//
////////////////////////////////////////////////////////////////////////
WCHAR* GetErrorName(HRESULT hr)
{
	return GetMapName(hr, NUMELEM(rgErrorMap), rgErrorMap);
}

////////////////////////////////////////////////////////////////////////
// WCHAR* GetInterfaceName
//
////////////////////////////////////////////////////////////////////////
WCHAR* GetInterfaceName(REFIID riid)
{
	//Loop through all interface arrays, looking for a string match to this interface...
	for(ULONG iObject=0; iObject<INVALID_INTERFACE; iObject++)
	{
		ULONG cInterfaces = 0;
		INTERFACEMAP* rgInterfaces = NULL;

		//Obtain the interface array for this object..
		GetInterfaceArray((EINTERFACE)iObject, &cInterfaces, &rgInterfaces);

		//Loop through the interfaces in this array
		for(ULONG iInterface=0; iInterface<cInterfaces; iInterface++)
		{
			if(riid == *rgInterfaces[iInterface].pIID)
				return rgInterfaces[iInterface].pwszName;
		}
	}

	return NULL;
}


////////////////////////////////////////////////////////////////////////
// STATUSMAP
//
////////////////////////////////////////////////////////////////////////
const static WIDENAMEMAP rgRowStatusMap[] =
{	
    VALUE_WCHAR(DBROWSTATUS_S_OK	),
	VALUE_WCHAR(DBROWSTATUS_S_MULTIPLECHANGES	),
	VALUE_WCHAR(DBROWSTATUS_S_PENDINGCHANGES	),
	VALUE_WCHAR(DBROWSTATUS_E_CANCELED	),
	VALUE_WCHAR(DBROWSTATUS_E_CANTRELEASE	),
	VALUE_WCHAR(DBROWSTATUS_E_CONCURRENCYVIOLATION	),
	VALUE_WCHAR(DBROWSTATUS_E_DELETED	),
	VALUE_WCHAR(DBROWSTATUS_E_PENDINGINSERT	),
	VALUE_WCHAR(DBROWSTATUS_E_NEWLYINSERTED	),
	VALUE_WCHAR(DBROWSTATUS_E_INTEGRITYVIOLATION	),
	VALUE_WCHAR(DBROWSTATUS_E_INVALID	),
	VALUE_WCHAR(DBROWSTATUS_E_MAXPENDCHANGESEXCEEDED	),
	VALUE_WCHAR(DBROWSTATUS_E_OBJECTOPEN	),
	VALUE_WCHAR(DBROWSTATUS_E_OUTOFMEMORY	),
	VALUE_WCHAR(DBROWSTATUS_E_PERMISSIONDENIED	),
	VALUE_WCHAR(DBROWSTATUS_E_LIMITREACHED	),
	VALUE_WCHAR(DBROWSTATUS_E_SCHEMAVIOLATION	),
};


////////////////////////////////////////////////////////////////////////
// WCHAR* GetRowStatusName
//
////////////////////////////////////////////////////////////////////////
WCHAR* GetRowStatusName(DBROWSTATUS dwRowStatus)
{
	return GetMapName((LONG)dwRowStatus, NUMELEM(rgRowStatusMap), rgRowStatusMap);
}


////////////////////////////////////////////////////////////////////////
// STATUSMAP
//
////////////////////////////////////////////////////////////////////////
const static WIDENAMEMAP rgBindStatusMap[] =
{	
    VALUE_WCHAR(DBBINDSTATUS_OK	),
	VALUE_WCHAR(DBBINDSTATUS_BADORDINAL	),
	VALUE_WCHAR(DBBINDSTATUS_UNSUPPORTEDCONVERSION	),
	VALUE_WCHAR(DBBINDSTATUS_BADBINDINFO	),
	VALUE_WCHAR(DBBINDSTATUS_BADSTORAGEFLAGS	),
	VALUE_WCHAR(DBBINDSTATUS_NOINTERFACE	),
	VALUE_WCHAR(DBBINDSTATUS_MULTIPLESTORAGE	),
};


////////////////////////////////////////////////////////////////////////
// WCHAR* GetBindStatusName
//
////////////////////////////////////////////////////////////////////////
WCHAR* GetBindStatusName(DBBINDSTATUS dwBindStatus)
{
	return GetMapName((LONG)dwBindStatus, NUMELEM(rgBindStatusMap), rgBindStatusMap);
}


////////////////////////////////////////////////////////////////////////
// ObjTypeMap
//
////////////////////////////////////////////////////////////////////////
const static WIDEGUIDMAP g_rgObjTypeMap[] =
{	
    & VALUE_WCHAR(DBGUID_DSO),
    & VALUE_WCHAR(DBGUID_SESSION),
    & VALUE_WCHAR(DBGUID_COMMAND),
    & VALUE_WCHAR(DBGUID_ROW),
    & VALUE_WCHAR(DBGUID_ROWSET),
    & VALUE_WCHAR(DBGUID_STREAM),
};
const static ULONG g_cObjTypeMap = NUMELEM(g_rgObjTypeMap);


////////////////////////////////////////////////////////////////////////
// WCHAR* GetObjectTypeName
//
////////////////////////////////////////////////////////////////////////
WCHAR* GetObjectTypeName(REFGUID rguid)
{
	return GetMapName(rguid, NUMELEM(g_rgObjTypeMap), g_rgObjTypeMap);
}


////////////////////////////////////////////////////////////////////////
// RowColMap
//
////////////////////////////////////////////////////////////////////////
const static WIDEDBIDMAP g_rgRowColMap[] =
{	
	& VALUE_WCHAR(DBROWCOL_DEFAULTSTREAM),        
	& VALUE_WCHAR(DBROWCOL_DEFAULTDOCUMENT),      
	& VALUE_WCHAR(DBROWCOL_ROWURL),		        
	& VALUE_WCHAR(DBROWCOL_PARSENAME),            
	& VALUE_WCHAR(DBROWCOL_PARENTNAME),           
	& VALUE_WCHAR(DBROWCOL_ABSOLUTEPARSENAME),    
	& VALUE_WCHAR(DBROWCOL_CONTENTTYPE),          
	& VALUE_WCHAR(DBROWCOL_CONTENTCLASS),         
	& VALUE_WCHAR(DBROWCOL_CONTENTLANGUAGE),      
	& VALUE_WCHAR(DBROWCOL_CREATIONTIME),         
	& VALUE_WCHAR(DBROWCOL_LASTACCESSTIME),       
	& VALUE_WCHAR(DBROWCOL_LASTWRITETIME),        
	& VALUE_WCHAR(DBROWCOL_STREAMSIZE),           
	& VALUE_WCHAR(DBROWCOL_DISPLAYNAME),          
	& VALUE_WCHAR(DBROWCOL_ISROOT),               
	& VALUE_WCHAR(DBROWCOL_ISCOLLECTION),         
	& VALUE_WCHAR(DBROWCOL_ISSTRUCTUREDDOCUMENT), 
	& VALUE_WCHAR(DBROWCOL_ISHIDDEN),             
	& VALUE_WCHAR(DBROWCOL_ISREADONLY),           
};
const static ULONG g_cRowColMap = NUMELEM(g_rgRowColMap);


////////////////////////////////////////////////////////////////////////
// STATUSMAP
//
////////////////////////////////////////////////////////////////////////
const static WIDENAMEMAP rgBindURLStatusMap[] =
{	
    VALUE_WCHAR(DBBINDURLSTATUS_S_OK),
	VALUE_WCHAR(DBBINDURLSTATUS_S_DENYNOTSUPPORTED),
	VALUE_WCHAR(DBBINDURLSTATUS_S_DENYTYPENOTSUPPORTED	),
	VALUE_WCHAR(DBBINDURLSTATUS_S_REDIRECTED	),
};


////////////////////////////////////////////////////////////////////////
// WCHAR* GetBindURLStatusName
//
////////////////////////////////////////////////////////////////////////
WCHAR* GetBindURLStatusName(DBBINDURLSTATUS dwBindStatus)
{
	return GetMapName((LONG)dwBindStatus, NUMELEM(rgBindURLStatusMap), rgBindURLStatusMap);
}




